for i in game.Players do i.character.Humanoid.health = 0 i.character.WalkSpeed = 0 print("Killed " .. p.Name) end
Basically this kills everyone and then sets their walkspeed to 0. The error is given at the very first line of this code.
On line 1
, in the definition of your generic for loop, you put game.Players
. That is an object of game - a userdata. But with the syntax of generic fors, it expects it to look like this;
for [variables] in [iterator function] do
In the place where an iterator function should have been, you put a userdata. Hence the error.
Use Pairs
as your iterator function, with arguments of a table full of all the players in the game - game.Players:GetPlayers()
for i,v in pairs(game.Players:GetPlayers()) do v.Character.:BreakJoints() end