|
| 26 Jun 2012 10:54 AM |
Im trying to make a Team Select GUI but for some reason it wont teleport the player to the right place so heres what i have....
-Lighting -Intro -Frame -TextButton -Script
function onButtonClicked() script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0 end
script.Parent.MouseButton1Click:connect(onButtonClicked) -Script
function Click() script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(3, 4.6, -26) end
script.Parent.MouseButton1Down:connect(Click)
I have the GUI in lighting because i only want the player to see it when he first joins. Does anyone know why its not teleporting the player to the right location? |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 11:00 AM |
"why isnt the player teleporting to the right spot"
Change the CFrame Value. |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 11:03 AM |
| The CFrame Value that I have in the script right now is where I want the player to teleport to. |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 26 Jun 2012 11:06 AM |
| You need 5 Parents for the CFrame as you did with the reset script. |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Jun 2012 11:11 AM |
Okay i added the extra Parent and it still does not work so the script looks like this now:
function Click() script.Parent.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(3, 4.6, -26) end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 26 Jun 2012 11:24 AM |
| Put it in 2 seperate scripts. 1 reset script and 1 team... |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Jun 2012 11:26 AM |
function onButtonClicked() script.Parent.Parent.Parent.Parent.Parent.Character:BreakJoints() script.Parent.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(3, 4.6, -26) end
script.Parent.MouseButton1Down:connect(onButtonClicked)
|
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 11:27 AM |
| How do i combine them because they were in two seperate scripts and didnt work |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Jun 2012 11:31 AM |
| It still doesnt teleport the player to that position |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 26 Jun 2012 11:32 AM |
| Ah, lol, I get you. Put 6 parents on. |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 11:33 AM |
Wait a Second...
Why are We teleporting the Player if We're killing it? |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 11:34 AM |
| 6 Parents would return "game.Players" |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 26 Jun 2012 11:36 AM |
| He might be making a reset gui and a teleport gui. |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 11:37 AM |
| You have to kill the player or the GUI will still be on the screen and your teleporting the player to the spawnpoint. |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
| |
|
|
| 26 Jun 2012 11:39 AM |
function onButtonClicked() script.Parent.Parent.Visible = false script.Parent.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(3, 4.6, -26) end
script.Parent.MouseButton1Down:connect(onButtonClicked) |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 11:39 AM |
| It isnt working yet but i havent tried adding a 6th parent do i need to do that? |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
| |
|
|
| 26 Jun 2012 11:42 AM |
| Okay the script works now but is there a way you can put a script into it that balances the teams out? |
|
|
| Report Abuse |
|
|
awas3
|
  |
| Joined: 24 Oct 2010 |
| Total Posts: 2854 |
|
|
| 26 Jun 2012 11:50 AM |
I think it would be:
function onClicked() game:GetService("Teams"):RebalanceTeams() end
script.Parent.MouseButton1Down:connect(onClicked)
This could be put into a loop as well.
while true do wait(5) game:GetService("Teams"):RebalanceTeams() wait(5) end
Rebalances the teams every 5 seconds. |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 11:52 AM |
| Would that need to be put in a new script or can i put it in the same script |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2012 11:53 AM |
6 Parents would return "game.Players"
Also, Your loop would fire every 10 Seconds.
And, I didn't know You could "RebalanceTeams" that way? |
|
|
| Report Abuse |
|
|