generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: BoolValue behaving wierdly?

Previous Thread :: Next Thread 
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
27 Aug 2011 02:51 AM
I have this part from a larger script:
if whoBOOL == true then
script.Parent.who:remove()
else print(script.Parent.whoBOOL.Value)
end

And it does not remove "who", but when it is asked to print the value... it returns TRUE?

Wtf is wrong...?
Report Abuse
leolion113 is not online. leolion113
Joined: 11 Oct 2008
Total Posts: 3336
27 Aug 2011 02:58 AM
"if whoBOOL == true then"

"print(script.Parent.whoBOOL.Value)"

Now can you see the problem with your if statement?

"if whoBOOL.Value == true then"
Report Abuse
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
27 Aug 2011 02:58 AM
"else"
Report Abuse
leolion113 is not online. leolion113
Joined: 11 Oct 2008
Total Posts: 3336
27 Aug 2011 03:00 AM
Nevermind then. Meh, I'm being stupid it seems.
Report Abuse
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
27 Aug 2011 03:01 AM
Its going to else and printing true even though it is true... Why is Roblox so broken? :(
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Aug 2011 03:03 AM
if whoBOOL.Value == true then
Report Abuse
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
27 Aug 2011 03:04 AM
I'm an idiot. >.<
Report Abuse
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
27 Aug 2011 03:16 AM
I had to add a check if it was still there otherwise it keeps breaking, and now it just skips the removing part... Why isn't it removing who even if whoBOOL is true?

if script.Parent.who then
if script.Parent.whoBOOL.Value == true then
script.Parent.who:remove()
end
end
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Aug 2011 03:19 AM
if script.Parent.who and script.Parent.whoBOOL.Value == true then
script.Parent.who:remove()
else print("Error")
end
Report Abuse
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
27 Aug 2011 03:25 AM
Yours is now removing who, but breaks the entire script afterwards. Surely the end would mean that everything after would continue at normal?
Report Abuse
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
27 Aug 2011 03:26 AM
E.g if this was the second time being run, would it print "Continuing"?

if script.Parent.who and script.Parent.whoBOOL.Value == true then
script.Parent.who:remove()
else print("Error")
end
print("Continuing")
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Aug 2011 03:26 AM
Yes, Whats the entire script?
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Aug 2011 03:27 AM
It should
Report Abuse
Munno is not online. Munno
Joined: 06 Oct 2008
Total Posts: 2784
27 Aug 2011 03:33 AM
I solved it by just removing who and the others when hey were activated. I can't make it look very nice, but it works.

What I mean is that even if who didn't exist would it still print Continuing? Because it would not. It would give me "who is not a valid member of Frame" errors (Even though its an if...?)
Report Abuse
smurf279 is not online. smurf279
Joined: 15 Mar 2010
Total Posts: 6871
27 Aug 2011 03:41 AM
Well it should have still print continuing since it was a if/then statement. Unless whoBOOL == nil then I don't know why it wouldn't have. . .
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image