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 :)
Value.Changed
What did I miss?
The event for when a NumberValue changes has the form of
NumberValue.Changed >> ( number NewValue );
Which means for you that you can connect to the Changed
event of workspace.Basics.Map
and check if your NewValue == 1