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
 

Re: Team Select GUI

Previous Thread :: Next Thread 
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
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
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
26 Jun 2012 11:00 AM
"why isnt the player teleporting to the right spot"

Change the CFrame Value.
Report Abuse
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
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 is not online. 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
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
26 Jun 2012 11:08 AM
okay thanks
Report Abuse
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
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 is not online. 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
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
26 Jun 2012 11:25 AM
@Above, No. COMBINE THEM.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
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
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
26 Jun 2012 11:27 AM
How do i combine them because they were in two seperate scripts and didnt work
Report Abuse
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
26 Jun 2012 11:27 AM
okay ill try that
Report Abuse
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
26 Jun 2012 11:31 AM
It still doesnt teleport the player to that position
Report Abuse
awas3 is not online. 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
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
26 Jun 2012 11:33 AM
Wait a Second...

Why are We teleporting the Player if We're killing it?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
26 Jun 2012 11:34 AM
6 Parents would return "game.Players"
Report Abuse
awas3 is not online. 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
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
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 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
26 Jun 2012 11:38 AM
Did it work?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
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
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
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 is not online. awas3
Joined: 24 Oct 2010
Total Posts: 2854
26 Jun 2012 11:40 AM
Yes.
Report Abuse
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
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 is not online. 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
austin10111213 is not online. austin10111213
Joined: 27 Nov 2008
Total Posts: 363
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
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
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
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