Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make a player teleport to a certain spawn when a TextButton is clicked?

Asked by
Grazer022 128
4 years ago
local waitingSpawn = game.Workspace.waitingRoom.waitingSpawn

local lobbySpawn = game.Workspace.Lobby.lobbySpawn
local textbutton = script.Parent.TextButton

i want it that when the player presses presses the textbutton you get teleported to lobbySpawn and it becomes your new spawn. Pls help me on this ;w;

Thanks!

  • Grazer022 ~ a learning scripter
0
I would like to know if you're using ScreenGui or SurfaceGui. Dovydas1118 1495 — 4y

1 answer

Log in to vote
1
Answered by
CyzDev 26
4 years ago

Changing the position of the player goes like this:

local humanoidRootPart = ect
local lobbySpawn = game.Workspace.Lobby.lobbySpawn

humanoidRootPart.Position = lobbySpawn.Position
0
Or you could use CFrame CyzDev 26 — 4y
0
The thing with teleporting people with Vector3 is that it will kill the player. So you need to use CFrame. Dovydas1118 1495 — 4y
0
thanks for the help! Grazer022 128 — 4y
Ad

Answer this question