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

Can Teleport Service Work In A Local Script?

local TeleportService = game:GetService("TeleportService")
gameID = game.Players.willie3838.PlayerGui.ScreenGui2.Teleport.Text

function onTouched(hit,player)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        TeleportService:Teleport(gameID, player)
    end
end

script.Parent.Touched:connect(onTouched)



My script requires it to run local, but if there's a way to access the gui "ScreenGui2" without using the player name or LocalPlayer, please tell me.

1 answer

Not exactly sure But I believe there is a method for doing so.

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