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

Surface GUI Universe Teleport Button Help?

I have tried tons of scripts but none will work for my SurfaceGUI on a simple part. I click it and nothing happens, nothing in the output too. I want it to teleport to a place in my game universe. Here is the code I've tried recently.

function onClicked(playerWhoClicked)
    local player = game.Players[playerWhoClicked]
    if player then
        game:GetService("TeleportService"):Teleport(512970811, player)
    end
end

5 comments

0

If you post the code it would help us better answer your question....

0

Edited.

0

Did you connect the event?

0

Um as far as I know, no.

0

Well, that would be a problem. Check the wiki for connecting events.

1 answer

script.Parent.Button1Down:connect(function(playerWhoClicked)
	local player = game.Players[playerWhoClicked]
	if player then
		game.GetService("TeleportService"):Teleport(512970811,player)
	end
end)

This script assumes that the script is in the button

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