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

How to prevent my teleport script teleporting to the place i just were?

Asked by 6 years ago

Okay so I have a serverscript in ServerScriptService and when a specific players says :update it teleports everyone to a server so the game can update but my script is teleporting to the place i just were instead it should teleport to the placeid Here is my script

names = {'Timmerman73','mastergozo123','thorcelli','trolltracker393YT'} 

game.Players.PlayerAdded:connect(function(player)
    for i, v in pairs(names) do
        if v == player.Name then 
            player.Chatted:connect(function(chatmsg)
                if chatmsg:sub(1,7) == ':update' then
                    local msg = Instance.new('Message',workspace)
                    msg.Text = 'S-S-F is getting an Update Teleporting'
                    wait(1)
                for _, player in pairs(game.Players:GetPlayers()) do
                    local tpservice = game:GetService('TeleportService')
                    local placeid = 1501752084
                tpservice:Teleport(placeid,player)          
end
end
end)
end
end 
end)

Help would be appreciated.

Answer this question