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

How to make a surface GUI teleporter?

Asked by 5 years ago
Edited 5 years ago

I'm not a really good scripter so I can't really explain what happened. I've tried many scripts (with friends) to make a Surface gui that teleports a Player to a different game. Nothing worked. Can somone help me out?

local Part = script.Parent
local CD = Part.ClickDetector
local GameId = 00000000  --example


CD.MouseClick:connect(function(Player)



game:GetService('TeleportService'):Teleport(GameId, Player)

end)

Well, this script isn't really working and I deleted it. But keep in mind that it is a SURFACE GUI. Not a Screen Gui.

Thanks for any help!

1 answer

Log in to vote
0
Answered by 5 years ago

Try starting out by putting a local script in starterplayerscripts that can check for when the surfacegui is clicked. Put a remote event in ReplicatedStorage because both the client and the server can access it. Once the surfacegui is clicked, call the server by using eventName:FireServer() with the needed parameters i.e. the player name and then let the server side script be called and handle the teleportation.

Ad

Answer this question