Hello, I made a script based on which if I press the gui button it should spawn the player to the specific brick I want. The script doesn't work. I am trying to make the script basically execute the action: if the player that joined the game is on team celtic to then spawn the player to the brick for celtic which is "Celticspawn". I inserted the script as a local script and made the local script a child to the parent (which is the gui textbutton). But in my script I made its not working. Any help thanks. Code is below:
if Player.Team == game.Teams.Celtic then
script.Parent.MouseButton1Click:connect(function()
game.Players.localPlayer.character.Torso.CFrame = CFrame.new(workspace.Celticspawn.Position)
end)
end

2 comments
You're using a localscript for a server-side effect. You have to use remote events.
Check output for errors so you know what's wrong, if there are none it's either working or not running. For starters you haven't defined Player before using it. If you're new to scripting I suggest you check out some basic tutorials first.