Astrock
|
  |
| Joined: 06 Jun 2010 |
| Total Posts: 240 |
|
|
| 05 Aug 2015 12:58 PM |
The problem is with the second if statement. The comments explain more. I can't see anything wrong with it.
local gui = game.StarterGui.Bottom.Frame
game.StarterGui.Bottom.Frame.State.Changed:connect(function(property) print('Changed') -- Always activates when changed if game.StarterGui.Bottom.Frame.State.Value == 0 then print ('Going down') -- Always activates when condition is met gui.choice1.Selectable = false gui.choice2.Selectable = false gui.choice3.Selectable = false for i=0,40 do wait(0.01) script.Parent.Position = UDim2.new(0.1,0,script.Parent.Position.Y.Scale + 0.005,0) if game.StarterGui.Bottom.Frame.State.Value == 1 then -- Mapping to the condition is correct, same mapping used above which always works. print ('Going up') -- Never activates when condition is met. Condition is changed to 1, printed and manually checked to confirm. gui.choice1.Selectable = true gui.choice2.Selectable = true gui.choice3.Selectable = true for i=0,40 do wait(0.01) script.Parent.Position = UDim2.new(0.1,0,script.Parent.Position.Y.Scale - 0.005,0) end end end
end
end) |
|
|
| Report Abuse |
|
|
FireLucet
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 84 |
|
|
| 05 Aug 2015 01:11 PM |
| Someone help this guy. Bump |
|
|
| Report Abuse |
|
|
|
| 05 Aug 2015 01:20 PM |
| any output or is it returning false the every time? |
|
|
| Report Abuse |
|
|
Astrock
|
  |
| Joined: 06 Jun 2010 |
| Total Posts: 240 |
|
|
| 05 Aug 2015 01:24 PM |
Here is my output:
Changed -- The value is changed to 0 Going down -- Goes down as a result Changed -- Value is changed to 1 1 -- Print the value
-- No Going up? |
|
|
| Report Abuse |
|
|
Astrock
|
  |
| Joined: 06 Jun 2010 |
| Total Posts: 240 |
|
|
| 05 Aug 2015 01:26 PM |
| Even when I manually go to the value and type in 1, the second if statement does not fire. |
|
|
| Report Abuse |
|
|