I made a guis that let players change their team, but I am stuck at let them spawn at a specific location if they select the team.
player = game.Players.LocalPlayer
if player.MouseButtonClick.script.Parent then
-- stucking at here.
I made a guis that let players change their team, but I am stuck at let them spawn at a specific location if they select the team.
player = game.Players.LocalPlayer
if player.MouseButtonClick.script.Parent then
-- stucking at here.
First we have to get the player's character. We can do this by doing
local player = game.Players.LocalPlayer
local character = player.Character
However, we probably want to wait for the character. We can make sure the Character has loaded by doing this,
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
Now we can get the Torso,
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local torso = character:WaitForChild("Torso")
You can use this at any time during the script. Just CFrame the torso to whatever position you would like. Example,
Torso.CFrame = CFrame.new(0,50,0)
Or you can teleport them to a part,
local part = workspace.Part
Torso.CFrame = part.CFrame
Good Luck!
I think you can do this turn on the AllowTeamChangeOnTouch when a gui gets clicked or brick and when they get tped to the spawn make a ontouch script turning AllowTeamChangeOnTouch false
OnTouch for spawnpoint thing
game.Teams.TeamName.AllowTeamChangeOnTouch = false
For brick to tp
game.Teams.TeamName.AllowTeamChangeOnTouch = true
and make a teleport script to the spawns position
can u just give me a full answer..
no the funny thing is you HAVE nothing done so your just asking for a WHOLE SCRIPT for your game
:P u just said AllowTeamChangeOnTouch and i have done 2 lines of script
This is an okay answer. I don't know what you're really asking tho :/
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Oh thanks and sorry for my confusing question
I should add this method only works in a Local Script.