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

My teleporting script teleports people forever. Can someone help me?

Asked by
ExcelUp 24
7 years ago

I'm trying to make a script that teleports people to a certain co-ordinate, but every time I load the game it continuously teleports players to the exact same location. Please could someone help me?

players = game.Players:GetChildren()
    repeat wait() until game.Players.NumPlayers > 1
    for teleporting = 1, #players do
        wait()
        toMove = players[teleporting].Character.Torso
        toMove.CFrame = CFrame.new(math.random(5,20), 75,math.random(165,175))
    end

0
What is your exact intentions with this? Teleport every player once? I can't help you fix this if I don't know what it's supposed to be doing in the first place. adark 5487 — 7y
0
The code is meant to teleport every player at once to a specified co-ordinate. ExcelUp 24 — 7y
0
What is the event that triggers this? Shawnyg 4330 — 7y
0
Use randomseed and a little wait to have different results. Also improve the code a little(Use GetPlayers(), not GetChildren()- use in pairs for this, #players - get rid of the useless wait() nothing - You're missing an end iamnoamesa 674 — 7y

Answer this question