• Timer Error: attempt to call a nil value
    1 replies, posted
I am getting the error: Timer Error: attempt to call a nil value With this code: [code]function countdown(pl) comboammount=pl:GetVar("comboammount") timeleft=pl:GetVar("timeleft") if pl:GetVar("timeleft")<=0 then pl:SetVar("comboammount",0) pl:SendLua("StreakCounter("..comboammount..","..timeleft..")") return end pl:SendLua("StreakCounter("..comboammount..","..timeleft..")") pl:SetVar("timeleft",timeleft-1) timer.Simple( 1, countdown(pl)) end[/code] any idea why this is happening? [highlight](User was banned for this post ("Wrong section" - mahalis))[/highlight]
[lua]timer.Simple( 1, countdown, pl )[/lua] In your code, you are sending the return value of your function to the timer (Which is nil).
Sorry, you need to Log In to post a reply to this thread.