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

Can Teleport Service Work In A Local Script?

Asked by 8 years ago
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

Log in to vote
0
Answered by 8 years ago

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

Ad

Answer this question