luizragna 41 Posted March 23, 2017 Hello guys, I have the following problem: When the character disconnects it should lose the buff exp bonus, but for some reason, when I enter the game buff continues - script Bonus EXP#Lose -1,{ OnPCLogoutEvent: set online,0; sc_end SC_EXPBOOST; end; } I put the script in an npc and it worked, but with OnPCLogoutEvent system not worked Quote Share this post Link to post Share on other sites
0 javierlog08 2 Posted March 23, 2017 Im not sure if OnPCLogoutEvent triggers the character that is going out the game.....Myabe your problem is cause the script have not a RID attached to it and cause that works on NPC, cause a NPC Triggers a RID on talking with it. I would recommend use ONPcLoginEvent Whetever, the solution should be using attachrid Script commandor wth doevent "<NPC object name>::<event label>"; Quote Share this post Link to post Share on other sites
0 luizragna 41 Posted March 23, 2017 In fact I realized that it does not work with variables Quote Share this post Link to post Share on other sites
0 Fou-lu 7 Posted March 25, 2017 I have a NPC equal to yours and even with some more functions.The NPC I created saves the time of Buff XP and checks when the player replays to see if there is still some time left for the Buff or it should be deleted.This avoids leaving the Buff time paralyzed when the player moves, as if time continues to roll. NPC: Buff Exp - script Check_Buff_Bonus_XP -1,{ OnPCLogoutEvent: if (getstatus(SC_CASH_PLUSEXP,0) == 1) set BuffXP_Tempo, gettimetick(2); end; OnPCLoginEvent: if (getstatus(SC_CASH_PLUSEXP,0) == 1) { set .@tempo, gettimetick(2)-BuffXP_Tempo; set .@tempo2,.@tempo*1000; if (.@tempo2 >= getstatus(SC_CASH_PLUSEXP,5)) { sc_end SC_CASH_PLUSEXP; end; } else { set .@rate, getstatus(SC_CASH_PLUSEXP,1); set .@temposet, getstatus(SC_CASH_PLUSEXP,5)-.@tempo2; sc_end SC_CASH_PLUSEXP; sc_start4 SC_CASH_PLUSEXP,.@temposet,.@rate,0,0,0; end; } } } NPC: Buff Drop - script Check_Buff_Bonus_Drop -1,{ OnPCLogoutEvent: if (getstatus(SC_CASH_RECEIVEITEM,0) == 1) set BuffDrop_Tempo, gettimetick(2); end; OnPCLoginEvent: if (getstatus(SC_CASH_RECEIVEITEM,0) == 1) { set .@tempo, gettimetick(2)-BuffDrop_Tempo; set .@tempo2,.@tempo*1000; if (.@tempo2 >= getstatus(SC_CASH_RECEIVEITEM,5)) { sc_end SC_CASH_RECEIVEITEM; end; } else { set .@rate, getstatus(SC_CASH_RECEIVEITEM,1); set .@temposet, getstatus(SC_CASH_RECEIVEITEM,5)-.@tempo2; sc_end SC_CASH_RECEIVEITEM; sc_start4 SC_CASH_RECEIVEITEM,.@temposet,.@rate,0,0,0; end; } } } Quote Share this post Link to post Share on other sites
I put the script in an npc and it worked, but with OnPCLogoutEvent system not worked
Share this post
Link to post
Share on other sites