Hello guys,so my problem is when I use the function GetPlayers()
you basically get all players in the server, for example:
--... local list = game:GetService('Players'):GetPlayers() for i,v in pairs(list) do repeat wait(0.5) LocalPlayer.CFrame = v.Character.HumanoidRootPart.CFrame * CFrame.new(0, 0, 1) until v.Character.Humanoid.Health <= 0 end end
My objetive is doesn't get the LocalPlayer, just other players. (Bc "local player" is you for example and you are a member of players)
Any idea?
Thanks.
Just add a basic if statement.
local list = game:GetService('Players'):GetPlayers() for i, v in pairs(list) do if not v == game.Players.LocalPlayer then -- run your code here end end
Well I found the mistake by my self, I just used "GetChildren" Instead of "GetPlayers".