A lua question

Timer Error: [gamemodes\mygamemode\gamemode\init.lua:86] attempt to index a nil value

timer.Create(“timer2”,4,0,function()
for k,v in pairs(player.GetAll()) do
if (v:GetRagdollEntity():GetModel() == “models/Zombie/Classic.mdl”) then
v:GetRagdollEntity():Remove()
end
end
end)

How do i execute this code clientside?

Please use [lua] [/lua] tags. Put it in lua/autorun/client

Do a ValidEntity() check on the v:GetRagdollEntity(). Also, use LUA tags next time.

I’m being pedantic but it’s Lua, not LUA (it isn’t an acronym).

How do i do that sry i am a newbie at lua doing my first gamemode :<

Type [lua] and end with /lua

[noparse][lua]code[/lua][/noparse]

Wait, how did you get it working? When I did those tags it dissapeared.

[noparse][noparse]message too short[/noparse][/noparse]

Ah, thanks.