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 » Scripters
Home Search
 

If Statement Won't Fire

Previous Thread :: Next Thread 
Astrock is not online. 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 is not online. FireLucet
Joined: 12 Jan 2009
Total Posts: 84
05 Aug 2015 01:11 PM
Someone help this guy. Bump
Report Abuse
FutureWebsiteOwner is not online. FutureWebsiteOwner
Joined: 29 Jul 2014
Total Posts: 468
05 Aug 2015 01:20 PM
any output or is it returning false the every time?
Report Abuse
Astrock is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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