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

time delay to teleport players.?

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

✓ Accepted answer

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)

3 comments

0

interesting guy, I'll try, thanks

0

He probably forgot an end

0

oh he did. I didn't notice that yesterday

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