kukayasko 6 Posted February 3, 2018 (edited) Quote - script hourlypoints FAKE_NPC,{ OnPCLoginEvent: if (getgmlevel() == 99){ initnpctimer; end; } OnTimer1000: getitem 20172,1; stopnpctimer; end; OnPCLogoutEvent: stopnpctimer; } Edited February 3, 2018 by kukayasko Quote Share this post Link to post Share on other sites
0 bWolfie 138 Posted February 3, 2018 firstly, you should describe what you are trying to achieve in the future when seeking support. When OnTimer is triggered, there is no player attached, so its trying to getitem without player attached. better to use addtimer/deltimer for this function also you dont need to stop the timer when they logout, since the data gets erased at that point anyway Quote Share this post Link to post Share on other sites
0 kukayasko 6 Posted February 3, 2018 Alright. Im trying to make a hourly reward. Sorry, lost what I had described when edited this topic. So how I attache a player to this code? Thought that just "get item" will be enough Quote Share this post Link to post Share on other sites
0 Nihad 24 Posted February 3, 2018 You are using the wrong timer command. *addtimer(<ticks>, "NPC::OnLabel") *deltimer("NPC::OnLabel") *addtimercount("NPC::OnLabel", <ticks>) These commands will create, destroy, and delay a countdown timer - addtimer() to create, deltimer() to destroy and addtimercount() to delay it by the specified number of ticks. For all three cases, the event label given is the identifier of that timer. The timer runs on the character object that is attached to the script, and can have multiple instances. When the label is run, it is run as if the player that the timer runs on has clicked the NPC. Quote Share this post Link to post Share on other sites
Share this post
Link to post
Share on other sites