For loops failing: "in" expected near "do"

My player_extension.lua won’t run properly and will return the error *
graverobber\gamemode\player_extension.lua:20: ‘in’ expected near ‘do’*. I’m not using a table to run the for loop, I just want to execute the code ‘n’ times.

[lua]function meta:DropBones( n )
for i, n do – line 20
if n == 0 then return end

	local bone = ents.Create( "sent_bone" )
	bone:SetPos( self:GetShootPos() )
	bone:Spawn()
end

self:SetBones( self:GetBones() - n )

end[/lua]

Try this:
[lua]for i=1, n do[/lua]

Thanks.

No problem :slight_smile: