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 |
|
|
|
| 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
|
  |
| Joined: 06 Oct 2008 |
| Total Posts: 2784 |
|
| |
|
|
| 27 Aug 2011 03:00 AM |
| Nevermind then. Meh, I'm being stupid it seems. |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 27 Aug 2011 03:03 AM |
| if whoBOOL.Value == true then |
|
|
| Report Abuse |
|
|
Munno
|
  |
| Joined: 06 Oct 2008 |
| Total Posts: 2784 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 27 Aug 2011 03:26 AM |
| Yes, Whats the entire script? |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
| |
|
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
|
  |
| 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 |
|
|