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 » Scripting Helpers
Home Search
 

Won't Work & Nothing in Output

Previous Thread :: Next Thread 
PhailThoth is not online. PhailThoth
Joined: 01 Apr 2011
Total Posts: 208
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 is not online. 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 is not online. 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
PhailThoth is not online. PhailThoth
Joined: 01 Apr 2011
Total Posts: 208
10 Jul 2011 04:01 PM
Yeah I'm learning, and thanks!
Report Abuse
PhailThoth is not online. PhailThoth
Joined: 01 Apr 2011
Total Posts: 208
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 is not online. 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
PhailThoth is not online. PhailThoth
Joined: 01 Apr 2011
Total Posts: 208
10 Jul 2011 04:12 PM
Alright thanks zeke.
- Still Nothing Happening and Really Confused About why It Won't Work -
Report Abuse
zeke505 is not online. 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
PhailThoth is not online. PhailThoth
Joined: 01 Apr 2011
Total Posts: 208
10 Jul 2011 04:23 PM
Sorry, but still doesn't work.
Report Abuse
chrisdead2 is not online. chrisdead2
Joined: 23 Jan 2010
Total Posts: 8231
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
PhailThoth is not online. PhailThoth
Joined: 01 Apr 2011
Total Posts: 208
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
PhailThoth is not online. PhailThoth
Joined: 01 Apr 2011
Total Posts: 208
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
PhailThoth is not online. PhailThoth
Joined: 01 Apr 2011
Total Posts: 208
11 Jul 2011 10:58 AM
Never mind got it working. Thanks to everyone who helped.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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