So I Made a script that teleports all players, It works in a button in a gui as a script (not local script). Howerver when i put it in a script in the Workspace It just doesnt teleport me
The working one
target = CFrame.new(-7.349, 0.5, -48.287)
function tele()
for i, player in ipairs(game.Players:GetChildren()) do
player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0)
end
end
script.Parent.MouseButton1Down:connect(tele)
The non working one
target = CFrame.new(-7.349, 0.5, -48.287)
function tele()
for i, player in ipairs(game.Players:GetChildren()) do
player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0)
end
end
game.Players.PlayerAdded:connect(tele)
I would like it to teleport all players when a NumberValue is = 1, the Value is locaed at game.Workspace.Basics.Map
Thanks for any help :)

1 comment
You would want to use the changed event then determine if the value the property has changed to was 1. Please make an attempt at creating this format of the script.