|
| 18 Jun 2013 05:34 PM |
So I wanted to make it so when you click the Text Button it opens,then one more click it closes.That use to work but I'm trying this.It's not working
script.Parent.MouseButton1Click:connect(function() print("Button1 click.") script.Parent.Image = "http://www.roblox.com/asset/?id=106542518" script.Parent.Parent.Parent.PFrame.Frame.Visible = true if script.Parent.Parent.Parent.PFrame.Frame.Visible == false then script.Parent.Parent.Parent.PFrame.Frame.Visible = false script.Parent.Power:Play() wait(5) script.Parent.Image = "http://www.roblox.com/asset/?id=106542506" end
|
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 05:36 PM |
| ...It use to work but when I added the if statement is stoped |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 05:38 PM |
| Well it did'nt start.The whole script stoped working. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 18 Jun 2013 05:50 PM |
hmm maybe if you did this... if script.Parent.Parent.Parent.PFrame.Frame.Visible then else
check your script.Parent.Parent.Parent thing to see if its the correct path |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 05:51 PM |
| It is the correct path and the whole script stoped working. |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Jun 2013 05:59 PM |
| Don't you need another 'end)'? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 18 Jun 2013 06:07 PM |
| Yea i have no idea what the error could be, sorry |
|
|
| Report Abuse |
|
|
| |
|
RoAnt
|
  |
| Joined: 14 Jul 2008 |
| Total Posts: 16794 |
|
|
| 18 Jun 2013 06:09 PM |
| You're missing an 'end' to close the if-statement. |
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 06:11 PM |
I did see.Not working
script.Parent.MouseButton1Click:connect(function() print("Button1 click.") script.Parent.Image = "http://www.roblox.com/asset/?id=106542518" script.Parent.Parent.Parent.PFrame.Frame.Visible = true if script.Parent.Parent.Parent.PFrame.Frame.Visible == false then script.Parent.Parent.Parent.PFrame.Frame.Visible = false end script.Parent.Power:Play() wait(5) script.Parent.Image = "http://www.roblox.com/asset/?id=106542506" end
|
|
|
| Report Abuse |
|
|
RoAnt
|
  |
| Joined: 14 Jul 2008 |
| Total Posts: 16794 |
|
|
| 18 Jun 2013 06:12 PM |
Also:
"if script.Parent.Parent.Parent.PFrame.Frame.Visible == false then script.Parent.Parent.Parent.PFrame.Frame.Visible = false script.Parent.Power:Play()"
If the condition is true (if the script.Parent.Parent.Parent.PFrame.Frame.Visible is false) why making it false again if it's already false?
|
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 06:13 PM |
| lol Made a mistake in that |
|
|
| Report Abuse |
|
|
RoAnt
|
  |
| Joined: 14 Jul 2008 |
| Total Posts: 16794 |
|
|
| 18 Jun 2013 06:14 PM |
What isn't working? Please show us your output...
"Don't ask others to debug your broken code without giving a hint what sort of problem you are having. " http://www.roblox.com/Forum/ShowPost.aspx?PostID=80625843
|
|
|
| Report Abuse |
|
|
|
| 18 Jun 2013 06:21 PM |
| I cant show the output because roblox keep saying there was an error was in the page |
|
|
| Report Abuse |
|
|
| |
|
| |
|
blocksee2
|
  |
| Joined: 23 Jul 2011 |
| Total Posts: 2659 |
|
|
| 18 Jun 2013 06:29 PM |
Yeah, I can't help you without the output saying something.
~I ᴅᴏɴ'ᴛ ᴋɴᴏᴡ, I ᴋɴᴏᴡ ʀɪɢʜᴛ?~ |
|
|
| Report Abuse |
|
|
RoAnt
|
  |
| Joined: 14 Jul 2008 |
| Total Posts: 16794 |
|
|
| 18 Jun 2013 06:30 PM |
Run this code since you can't post the output:
script.Parent.MouseButton1Click:connect(function() print("Button1 click.") script.Parent.Image = "http://www.roblox.com/asset/?id=106542518" print("Image works") script.Parent.Parent.Parent.PFrame.Frame.Visible = true print("Visibility works") if script.Parent.Parent.Parent.PFrame.Frame.Visible == false then print("If statement has been accessed.") script.Parent.Parent.Parent.PFrame.Frame.Visible = false print("Visibility is now false.") end script.Parent.Power:Play() print("Sound played.") wait(5) script.Parent.Image = "http://www.roblox.com/asset/?id=106542506" print("2nd image loaded.") end |
|
|
| Report Abuse |
|
|
| |
|