|
| 10 Jul 2011 03:51 PM |
Problem: Nothing happens when clicked on gui button What's supposed to happen: You disappear, torso anchored, then reappear at a different location, torso unanchored. Then the text changes, causing the script to work differently. You then disappear, torso anchored, then reappear at the "observing room", torso unanchored. Script:
torso = script.Parent.Parent.Parent.Parent.Character['Torso'] larm = script.Parent.Parent.Parent.Parent.Character['Left Arm'] lleg = script.Parent.Parent.Parent.Parent.Character['Left Leg'] rarm = script.Parent.Parent.Parent.Parent.Character['Right Arm'] rleg = script.Parent.Parent.Parent.Parent.Character['Right Leg']
function onButtonClicked() if script.Parent.Text == "To Ball Physics Test" then do torso.Anchored = true torso.Transparency = .2 larm.Transparency = .2 lleg.Transparency = .2 rarm.Transparency = .2 rleg.Transparency = .2 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .6 larm.Transparency = .6 lleg.Transparency = .6 rarm.Transparency = .6 rleg.Transparency = .6 wait(.2) torso.Transparency = .8 larm.Transparency = .8 lleg.Transparency = .8 rarm.Transparency = .8 rleg.Transparency = .8 wait(.2) torso.Transparency = 1 larm.Transparency = 1 lleg.Transparency = 1 rarm.Transparency = 1 rleg.Transparency = 1 torso.CFrame = CFrame.new(Vector3.new( 18, 0.5, -8)) torso.Transparency = 1 larm.Transparency = 1 lleg.Transparency = 1 rarm.Transparency = 1 rleg.Transparency = 1 wait(.2) torso.Transparency = .8 larm.Transparency = .8 lleg.Transparency = .8 rarm.Transparency = .8 rleg.Transparency = .8 wait(.2) torso.Transparency = .6 larm.Transparency = .6 lleg.Transparency = .6 rarm.Transparency = .6 rleg.Transparency = .6 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .2 larm.Transparency = .2 lleg.Transparency = .2 rarm.Transparency = .2 rleg.Transparency = .2 wait(.2) torso.Anchored = false script.Parent.Text = "Teleport Back" end else if script.Parent.Text == "Teleport Back" then do torso.Anchored = true torso.Transparency = .2 larm.Transparency = .2 lleg.Transparency = .2 rarm.Transparency = .2 rleg.Transparency = .2 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .6 larm.Transparency = .6 lleg.Transparency = .6 rarm.Transparency = .6 rleg.Transparency = .6 wait(.2) torso.Transparency = .8 larm.Transparency = .8 lleg.Transparency = .8 rarm.Transparency = .8 rleg.Transparency = .8 wait(.2) torso.Transparency = 1 larm.Transparency = 1 lleg.Transparency = 1 rarm.Transparency = 1 rleg.Transparency = 1 torso.CFrame = CFrame.new(Vector3.new( 9.2, 146.7, 0)) torso.Transparency = 1 larm.Transparency = 1 lleg.Transparency = 1 rarm.Transparency = 1 rleg.Transparency = 1 wait(.2) torso.Transparency = .8 larm.Transparency = .8 lleg.Transparency = .8 rarm.Transparency = .8 rleg.Transparency = .8 wait(.2) torso.Transparency = .6 larm.Transparency = .6 lleg.Transparency = .6 rarm.Transparency = .6 rleg.Transparency = .6 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .2 larm.Transparency = .2 lleg.Transparency = .2 rarm.Transparency = .2 rleg.Transparency = .2 wait(.2) torso.Anchored = false script.Parent.Text = "To Ball Physics Test" end end end end script.Parent.MouseButton1Click:connect(onButtonClicked)
If you could help, that would be great! Thanks in advance. -PhailThoth |
|
|
| Report Abuse |
|
|
Xknite
|
  |
| Joined: 03 Jul 2008 |
| Total Posts: 181 |
|
|
| 10 Jul 2011 03:57 PM |
Change the last line to:
script.Parent.MouseButton1Down:connect(onButtonClicked)
|
|
|
| Report Abuse |
|
|
juriaan
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 939 |
|
|
| 10 Jul 2011 04:00 PM |
I would learn the for do loop. It is much more Handy then all this Lines that you don't need to Type. But I know you are learning. I guess so.
Buy Yeah Xknite is right. Change that line and it would be Fixed..
Juriaan |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 04:01 PM |
| Yeah I'm learning, and thanks! |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 04:04 PM |
| Sorry to bother you guys again, but it still doesn't work without anything in output.... |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 10 Jul 2011 04:06 PM |
elseif, not else if
you don't need a do after then, so get rid of the extra end |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 04:12 PM |
Alright thanks zeke. - Still Nothing Happening and Really Confused About why It Won't Work - |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 10 Jul 2011 04:15 PM |
| You need to get rid of all the do's and all the extra ends. At the end of the function you will only need two ends and none throughout the function. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 04:23 PM |
| Sorry, but still doesn't work. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 04:33 PM |
function onButtonClicked() if script.Parent.Text == "To Ball Physics Test" then torso.Anchored = true torso.Transparency = .2 larm.Transparency = .2 lleg.Transparency = .2 rarm.Transparency = .2 rleg.Transparency = .2 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .6 larm.Transparency = .6 lleg.Transparency = .6 rarm.Transparency = .6 rleg.Transparency = .6 wait(.2) torso.Transparency = .8 larm.Transparency = .8 lleg.Transparency = .8 rarm.Transparency = .8 rleg.Transparency = .8 wait(.2) torso.Transparency = 1 larm.Transparency = 1 lleg.Transparency = 1 rarm.Transparency = 1 rleg.Transparency = 1 torso.CFrame = CFrame.new(Vector3.new( 18, 0.5, -8)) torso.Transparency = 1 larm.Transparency = 1 lleg.Transparency = 1 rarm.Transparency = 1 rleg.Transparency = 1 wait(.2) torso.Transparency = .8 larm.Transparency = .8 lleg.Transparency = .8 rarm.Transparency = .8 rleg.Transparency = .8 wait(.2) torso.Transparency = .6 larm.Transparency = .6 lleg.Transparency = .6 rarm.Transparency = .6 rleg.Transparency = .6 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .2 larm.Transparency = .2 lleg.Transparency = .2 rarm.Transparency = .2 rleg.Transparency = .2 wait(.2) torso.Anchored = false script.Parent.Text = "Teleport Back" end else script.Parent.Text == "Teleport Back" torso.Anchored = true torso.Transparency = .2 larm.Transparency = .2 lleg.Transparency = .2 rarm.Transparency = .2 rleg.Transparency = .2 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .6 larm.Transparency = .6 lleg.Transparency = .6 rarm.Transparency = .6 rleg.Transparency = .6 wait(.2) torso.Transparency = .8 larm.Transparency = .8 lleg.Transparency = .8 rarm.Transparency = .8 rleg.Transparency = .8 wait(.2) torso.Transparency = 1 larm.Transparency = 1 lleg.Transparency = 1 rarm.Transparency = 1 rleg.Transparency = 1 torso.CFrame = CFrame.new(Vector3.new( 9.2, 146.7, 0)) torso.Transparency = 1 larm.Transparency = 1 lleg.Transparency = 1 rarm.Transparency = 1 rleg.Transparency = 1 wait(.2) torso.Transparency = .8 larm.Transparency = .8 lleg.Transparency = .8 rarm.Transparency = .8 rleg.Transparency = .8 wait(.2) torso.Transparency = .6 larm.Transparency = .6 lleg.Transparency = .6 rarm.Transparency = .6 rleg.Transparency = .6 wait(.2) torso.Transparency = .4 larm.Transparency = .4 lleg.Transparency = .4 rarm.Transparency = .4 rleg.Transparency = .4 wait(.2) torso.Transparency = .2 larm.Transparency = .2 lleg.Transparency = .2 rarm.Transparency = .2 rleg.Transparency = .2 wait(.2) torso.Anchored = false script.Parent.Text = "To Ball Physics Test" end end script.Parent.MouseButton1Down:connect(onButtonClicked)
|
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 04:42 PM |
Uhmm Chris... That's what I have except with an extra end in the middle and without varriables. Could anyone help me with this? I can't seem to find the problem even though I'm looking through the script line by line. |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2011 05:52 PM |
| Alright I'm out of ideas, I am gonna stop with this for a while, if any one could fix this, it would be great. |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2011 10:58 AM |
| Never mind got it working. Thanks to everyone who helped. |
|
|
| Report Abuse |
|
|