I tried a script I got from a youtuber (https://www.youtube.com/watch?v=-WBIcg-RDeE&safe=active) that allowed my character to teleport to a certain spot in my game. I put the following script in the StarterGui location:
local player = game.Players.LocalPlayer workspace.Part.SurfaceGui.TextButton.MouseButton1Click: connect (function() if player.Character and player.Character:FindFirstChild("Torso") then player.Character.Torso.CFrame = CFrame.new(15, 15, 15) end end)
Any bugfixes?
thanks a ton, A Nooby Scripter
Anything else I must add just comment.
First up, put a new screen GUI into starter GUI. Then, put a Text Button into the screen GUI, and after that put a script into the TextButton. In the script, put this (Make sure you are teleporting to a spawn, and name the spawn SpawnLocation1.)
spawn = game.Workspace.SpawnLocation2 player = script.Parent.Parent.Parent.Parent
function onClicked() player.Character:MoveTo(spawn.Position) end
script.Parent.MouseButton1Down:connect(onClicked)
When you click on the GUI, the computer finds the position of the spawn, and moves the character to it.
I know this is a different GUI, but it's easier to type and you can easily make multiple of them (To make multiple, put a new spawn where you want to teleport, and name the spawn something else like SPawnLocation2, and just change the name of the spawn in the script.)
Hope it helps!