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

time delay to teleport players.?

Asked by
lytew 99
4 years ago
Edited 4 years ago

I want to create a button that when someone presses, all players are teleported to the x, y, z area the problem is that this script teleports the player that clicked first and only after a few seconds, other players (tested on LocalServer in Roblox Studio

script:

local teleporte = script.Parent


function onClicked()

local p = game.Players:GetChildren()
for i = 1, #p do
p[i].Character:MoveTo(Vector3.new(-55.831, 11.008, 183.894))
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

Log in to vote
1
Answered by
synkrio 281 Moderation Voter
4 years ago

I don't really know what's wrong with your code but maybe you can try this

local teleporte = script.Parent

function onClicked()
for i,v in pairs(game.Players:GetChildren())do
    v.Character:MoveTo(Vector.new(-55.831, 11.008, 183.894))
end
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)
0
interesting guy, I'll try, thanks lytew 99 — 4y
0
He probably forgot an end SoftlockedUnderZero 668 — 4y
0
oh he did. I didn't notice that yesterday synkrio 281 — 4y
Ad

Answer this question