Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Why am I getting this error repeatedly?

$
0
0
Assets/scripting_basics2.js(106,21): BCE0067: There is already a local variable with the name 'doesFightHappen'. error, I'm just learning to use javascript, and just playing around, and this is the script. . . function Update () { var skylerHappy : boolean = true; var meganHappy = false; var skylerCigarretes = 4; var meganShoesOn = true; var dishesInSink = true; var poopOnFloor = true; var doesFightHappen : boolean = false; if (skylerHappy == true && skylerCigarretes >= 2) { var doesFightHappen = false; print (doesFightHappen); } else { var doesFightHappen = true; print (doesFightHappen); } } K, so it may be sloppy, and I'm sure I messed it up somewhere stupid, but why wouldn't I be able to change that variable like that to true if I was not happy, and did not have smokes left?!?!? I stared at it for 10 minutes, can't find the error, and the error doesn't bother me so much as needing to know why its wrong so I don't do it when I'm actually coding something serious.

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>