• A lua question
    9 replies, posted
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.
[QUOTE=freemmaann;27521397]Do a ValidEntity() check on the v:GetRagdollEntity(). Also, use LUA tags next time.[/QUOTE] I'm being pedantic but it's Lua, not LUA (it isn't an acronym).
[QUOTE=freemmaann;27521397]Do a ValidEntity() check on the v:GetRagdollEntity(). Also, use LUA tags next time.[/QUOTE] How do i do that sry i am a newbie at lua doing my first gamemode :<
Type [lua] and end with /lua
[QUOTE=Persious;27522167]Type [lua] and end with /lua[/QUOTE] [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.
Sorry, you need to Log In to post a reply to this thread.