I have no idea where to start! Any help would be great!
I tried doing
script.Parent.MouseClick:Connect(function(player)
for i, v in pairs(game.Players:GetChildren()) do
v.Position = Vector3.new(3,3,3)
I have no idea where to start! Any help would be great!
I tried doing
script.Parent.MouseClick:Connect(function(player)
for i, v in pairs(game.Players:GetChildren()) do
v.Position = Vector3.new(3,3,3)
A person's player is kind of like the information about them, but what you actually see in the world is their character. You can get a player's character with player.Character, and you can teleport the character by changing the position of the HumanoidRootPart
script.Parent.MouseClick:Connect(function(player)
for i, v in pairs(game.Players:GetChildren()) do
if v.Character then -- make sure the player has a character so that it won't crash the script if they are respawning or something
v.Character.HumanoidRootPart.Position = Vector3.new(3, 3, 3)
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Ohhh so I am supposed to check if there is a character first?
typically yeah, and "if v.Character" is just a shorter way of writing 'if v.Character ~= nil"
Thanks guys!