• Notification with timer not working
    2 replies, posted
So I'm trying to make a notification, which shows up if the players health is equal to or lower than 25, every 30 seconds, for a duration of 5 seconds. But none of it is working, no errors or anything. Without a timer the player will be spammed with notifications. [lua] function notifyplayer( ply ) for _, ply in pairs( player.GetAll() ) do if ( ply:Alive() ) then if ply:Health() <= 25 then ply:SendLua("GAMEMODE:AddNotify(\"this should pop up?\", NOTIFY_GENERIC, 4)") end end end end timer.Create( "notifytimer", 10, 1, notifyplayer, ply ) [/lua]
The third argument to timer.Create is how many times the timer should tick for, you set this to 1. Change that to 0 for it to tick every 10 seconds, not just the first 10 seconds of the game.
[QUOTE=zzaacckk;40783895]The third argument to timer.Create is how many times the timer should tick for, you set this to 1. Change that to 0 for it to tick every 10 seconds, not just the first 10 seconds of the game.[/QUOTE] Alright, I changed that. But the issue still strives. EDIT: Found a fix.
Sorry, you need to Log In to post a reply to this thread.