• [HELP] About timers
    4 replies, posted
Hey Guys, I have a simple question If I make an Infinite Timer to simple check something for example [LUA]timer.Create("Example", 0.1, 0, function(ply) if ply:Health() = 0 then ply:Kill() end[/LUA] Would it lag the server? Or would it make any kind of problems at all?
It will create errors because ply is nil.
[QUOTE=Robotboy655;44497842]It will create errors because ply is nil.[/QUOTE] xD ok, so: [LUA] timer.Create("TheLevels", 0.1, 0, function() for k, v in pairs( player.GetAll( ) ) do if v:Health() = 0 then v:Kill() end end) [/LUA] Would not make any problems?
Such small code can go inside a Think hook, oh and "=" is for assignment, use "==" for comparison, and your code is missing a "end"
[QUOTE=DEFCON1;44497973]Such small code can go inside a Think hook, oh and "=" is for assignment, use "==" for comparison, and your code is missing a "end"[/QUOTE] Thanks :)
Sorry, you need to Log In to post a reply to this thread.