So I am now having trouble with the teleporting part for the other players. It teleports the sniper fine. But won't teleport the other players
Gives me this error: "Torso is not a valid member of Player, Line 44 (Or in this post, line 16)
local players = game.Players:GetChildren() print(#players) if #players >= 2 then local sniper = players[math.random(1,#players)] local chosenName = sniper.Name local weapon = game.Lighting.Sniper weapon.Parent = sniper.Backpack sniper.Character.Torso.CFrame = game.Workspace:FindFirstChild("SniperPosition").CFrame * CFrame.new(0,1,0) for i,v in pars(players) do if v.Name ~= chosenName then v.Torso = game.Workspace:FindFirstChild("PlayerPosition").CFrame * CFrame.new(0,1,0) -- This part. end end
Basically all you have to do is make a variable and define it as the name of the player. After doing this you can teleport the rest. So in the condition on line 29 add the following
local players = game.Players:GetChildren() --Part I need help with. print(#players) if #players >= 2 then local sniper = players[math.random(1,#players)] local chosenName = sniper.Name local weapon = game.Lighting.Sniper weapon.Parent = sniper.Backpack sniper.Character.Torso.CFrame = game.Workspace:FindFirstChild(ItemHere).CFrame * CFrame.new(0,1,0) for i,v in pars(players) do if v.Name ~= chosenName then v.Torso = game.Workspace:FindFirstChild(ItemHere).CFrame * CFrame.new(0,1,0) end end
This script should teleport the players without the name of the chosen sniper
~~Hope i helped