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

How would I make a player teleport to another game when a GUI is clicked?

Asked by 10 years ago

I can never figure this out, could anybody help me out here?

2 answers

Log in to vote
1
Answered by 10 years ago

Hmm, Try this (Place inside the TextButton);

repeat wait(0)until game.Players.LocalPlayer and game.Players.LocalPlayer:FindFirstChild("PlayerGui") -- Repeats waiting 0 seconds until LocalPlayer, and LocalPlayer's PlayerGui
local PlaceId = 000000 --Replace the 0's with the place ID you want the player to teleport two when player clicks on it
script.Parent.MouseButton1Down:connect(function() --When LocalPlayer clicks on the Gui
game:GetService("TeleportService"):Teleport(PlaceId, game.Players.LocalPlayer) --Teleports the LocalPlayer to the desired place
end) --The end) for the MouseButton1Down event

Hope this helped!

0
I already have a textButton. Mind editing it to work with that? SchonATL 15 — 10y
0
Oh, sure. TheeDeathCaster 2368 — 10y
0
There, that should do it! TheeDeathCaster 2368 — 10y
0
Thank you! SchonATL 15 — 10y
0
No problem. ;) TheeDeathCaster 2368 — 10y
Ad
Log in to vote
0
Answered by 10 years ago
local MyPlaceId = 0
local IWANNATELENOW = game:GetService("TeleportService")
local player = game.Players.LocalPlayer
function IGOTABUCKETLOADOFCHEESE()
IWANNATELENOW:Teleport(MyPlaceId, player)
end
script.Parent.MouseButton1Click:connect(IGOTABUCKETLOADOFCHEESE)

Answer this question