I'm making a game called Intensity, it's a First and 3rd person shooter. At the moment my GUI when clicked gives the player that gun and the GUI is disabled until they respawn/die. I want it so they spawn on a SpawnLocation of red/blue and teleport to a certain place in the map, I guess this would involve co-ordinates.
So the script wants to be like this..
--Once player selects gun, is cloned from Lightening into backpack --GUI is disabled --Automatically teleport to an area of the map --When die the GUI reappears --Repeats above
To teleport a player, you just have to set his torso's CFrame to the desired coordinates :
script.Parent.MouseButton1Click:connect(function() --Give gun game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(Vector3.new(10, 50, 20)) --Make sure to edit those coordinates ! end)
Don't worry about making the script "regen" on death. Since it's a GUI, it will execute each time the player respawns.