Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a surface GUI teleporter?

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

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.