Takuyakii Posted August 12, 2022 Posted August 12, 2022 Good day! Can someone help me, to fix this error ? buildin_getunitdata: Error in Argument! Please give a variable to store value in Script: Quote payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.@HP_Bar == 0) { .@HP_Bar = 1; .@mobGID = monster ("payon",148,226,"[T] HP Test",1031,1,strnpcinfo(0)+"::OnMobDie"); .@mid =$@mobid[.@i]; setunitdata .@mid,UMOB_MAXHP,4000; setunitdata .mid,UMOB_HP,4000; .@count = getmapunits(BL_PC, "payon", .@units); for (.@i = 0; .@i < .@count; .@i++) { attachrid .@units[.@i]; addtimer(0,strnpcinfo(0)+"::OnHPBar"); } } end; OnMobDie: .@HP_Bar = 0; end; OnHPBar: .@U_MAXHP = getunitdata (.@mid, UMOB_MAXHP); while (.@HP_Bar != 0) { .@U_HP = getunitdata (.@mid, UMOB_HP); .@P_HP = (.@U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } cutin("0", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } Also the cutin are not following the hp, refer to this link: https://board.herc.ws/topic/15975-custom-unit-hp-bar-system/ Quote
0 Pride Posted August 12, 2022 Posted August 12, 2022 payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.@HP_Bar == 0) { .@HP_Bar = 1; monster ("payon",148,226,"[T] HP Test",1031,1,strnpcinfo(0)+"::OnMobDie"); .mid =$@mobid; getunitdata .mid, .@unitdata; setunitdata .mid,UMOB_MAXHP,4000; setunitdata .mid,UMOB_HP,4000; .@count = getmapunits(BL_PC, "payon", .@units); for (.@i = 0; .@i < .@count; .@i++) { attachrid .@units[.@i]; addtimer(0,strnpcinfo(0)+"::OnHPBar"); } } end; OnMobDie: .@HP_Bar = 0; end; OnHPBar: .getunitdata .mid,.@unitdata; .@U_MAXHP = .@unitdata[UMOB_MAXHP]; while (.@HP_Bar != 0) { .@U_HP = .@unitdata[UMOB_HP]; .@P_HP = (.@U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } cutin("0", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } 1 Quote
0 Pride Posted August 12, 2022 Posted August 12, 2022 (edited) payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.@HP_Bar == 0) { .@HP_Bar = 1; .@mid = monster ("payon",148,226,"[T] HP Test",1031,1,strnpcinfo(0)+"::OnMobDie"); getunitdata .@mid, .@unitdata; setunitdata .@mid,UMOB_MAXHP,4000; setunitdata .@mid,UMOB_HP,4000; .@count = getmapunits(BL_PC, "payon", .@units); for (.@i = 0; .@i < .@count; .@i++) { attachrid .@units[.@i]; addtimer(0,strnpcinfo(0)+"::OnHPBar"); } } end; OnMobDie: .@HP_Bar = 0; end; OnHPBar: .@U_MAXHP = getunitdata .@mid, UMOB_MAXHP; while (.@HP_Bar != 0) { .@U_HP = getunitdata .@mid, UMOB_HP; .@P_HP = (.@U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } cutin("0", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } Try this. i have not tested it but let me know if it worked Edited August 12, 2022 by Pride Quote
0 Takuyakii Posted August 12, 2022 Author Posted August 12, 2022 20 minutes ago, Pride said: payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.@HP_Bar == 0) { .@HP_Bar = 1; .@mid = monster ("payon",148,226,"[T] HP Test",1031,1,strnpcinfo(0)+"::OnMobDie"); getunitdata .@mid, .@unitdata; setunitdata .@mid,UMOB_MAXHP,4000; setunitdata .@mid,UMOB_HP,4000; .@count = getmapunits(BL_PC, "payon", .@units); for (.@i = 0; .@i < .@count; .@i++) { attachrid .@units[.@i]; addtimer(0,strnpcinfo(0)+"::OnHPBar"); } } end; OnMobDie: .@HP_Bar = 0; end; OnHPBar: .@U_MAXHP = getunitdata .@mid, UMOB_MAXHP; while (.@HP_Bar != 0) { .@U_HP = getunitdata .@mid, UMOB_HP; .@P_HP = (.@U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } cutin("0", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } Try this. i have not tested it but let me know if it worked Tested and put some ( ) under .@mid because of the error, then after that igot the same error buildin_getunitdata: Error in Argument! Please give a variable to store value in Quote
0 Takuyakii Posted August 12, 2022 Author Posted August 12, 2022 @Pride Line 26 Changed into this after that there's no error on map but when im talking to npc to summon the monster, i got this error buildin_getunitdata: Error in Argument! Please give a variable to store value in .@U_MAXHP = getunitdata (.@mid, UMOB_MAXHP); while (.@HP_Bar != 0) { .@U_HP = getunitdata (.@mid, UMOB_HP); .@P_HP = (.@U_HP*100)/.@U_MAXHP; Quote
0 Pride Posted August 12, 2022 Posted August 12, 2022 (edited) 28 minutes ago, Takuyakii said: @Pride Line 26 Changed into this after that there's no error on map but when im talking to npc to summon the monster, i got this error buildin_getunitdata: Error in Argument! Please give a variable to store value in .@U_MAXHP = getunitdata (.@mid, UMOB_MAXHP); while (.@HP_Bar != 0) { .@U_HP = getunitdata (.@mid, UMOB_HP); .@P_HP = (.@U_HP*100)/.@U_MAXHP; OnHPBar: .getunitdata .@mid,.@unitdata; .U_MAXHP = .@unitdata[UMOB_MAXHP]; while (.HP_Bar != 0) { .U_HP = .@unitdata[UMOB_HP]; .P_HP = (.U_HP*100)/.U_MAXHP; cutin(""+.P_HP+"", 1); sleep2 100; } This should solve it Edited August 12, 2022 by Pride Quote
0 Takuyakii Posted August 12, 2022 Author Posted August 12, 2022 1 minute ago, Pride said: OnHPBar: .getunitdata .@mid,.@unitdata; while (.HP_Bar != 0) { .U_HP = .@unitdata[UMOB_HP]; .P_HP = (.U_HP*100)/.U_MAXHP; cutin(""+.P_HP+"", 1); sleep2 100; } This should solve it Quote
0 Takuyakii Posted August 12, 2022 Author Posted August 12, 2022 Just now, Takuyakii said: Fixed removed . on getunitdata, now there's a new error Quote
0 Pride Posted August 12, 2022 Posted August 12, 2022 Just now, Takuyakii said: payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.@HP_Bar == 0) { .@HP_Bar = 1; .@mobGID = monster ("payon",148,226,"[T] HP Test",1031,1,strnpcinfo(0)+"::OnMobDie"); .@mid =$@mobid[.@i]; setunitdata .@mobGID,UMOB_MAXHP,4000; setunitdata .@mobGID,UMOB_HP,4000; .@count = getmapunits(BL_PC, "payon", .@units); for (.@i = 0; .@i < .@count; .@i++) { attachrid .@units[.@i]; addtimer(0,strnpcinfo(0)+"::OnHPBar"); } } end; OnMobDie: .@HP_Bar = 0; end; OnHPBar: .getunitdata .@mid,.@unitdata; .@U_MAXHP = .@unitdata[UMOB_MAXHP]; while (.@HP_Bar != 0) { .@U_HP = .@unitdata[UMOB_HP]; .@P_HP = (.@U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } cutin("0", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } Quote
0 Takuyakii Posted August 12, 2022 Author Posted August 12, 2022 Just now, Pride said: payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.@HP_Bar == 0) { .@HP_Bar = 1; .@mobGID = monster ("payon",148,226,"[T] HP Test",1031,1,strnpcinfo(0)+"::OnMobDie"); .@mid =$@mobid[.@i]; setunitdata .@mobGID,UMOB_MAXHP,4000; setunitdata .@mobGID,UMOB_HP,4000; .@count = getmapunits(BL_PC, "payon", .@units); for (.@i = 0; .@i < .@count; .@i++) { attachrid .@units[.@i]; addtimer(0,strnpcinfo(0)+"::OnHPBar"); } } end; OnMobDie: .@HP_Bar = 0; end; OnHPBar: .getunitdata .@mid,.@unitdata; .@U_MAXHP = .@unitdata[UMOB_MAXHP]; while (.@HP_Bar != 0) { .@U_HP = .@unitdata[UMOB_HP]; .@P_HP = (.@U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } cutin("0", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } New error Quote
0 Takuyakii Posted August 12, 2022 Author Posted August 12, 2022 Just now, Pride said: payon,147,229,4 script Test#HPbar 1_F_MARIA,{ if (.@HP_Bar == 0) { .@HP_Bar = 1; monster ("payon",148,226,"[T] HP Test",1031,1,strnpcinfo(0)+"::OnMobDie"); .mid =$@mobid; getunitdata .mid, .@unitdata; setunitdata .mid,UMOB_MAXHP,4000; setunitdata .mid,UMOB_HP,4000; .@count = getmapunits(BL_PC, "payon", .@units); for (.@i = 0; .@i < .@count; .@i++) { attachrid .@units[.@i]; addtimer(0,strnpcinfo(0)+"::OnHPBar"); } } end; OnMobDie: .@HP_Bar = 0; end; OnHPBar: .getunitdata .mid,.@unitdata; .@U_MAXHP = .@unitdata[UMOB_MAXHP]; while (.@HP_Bar != 0) { .@U_HP = .@unitdata[UMOB_HP]; .@P_HP = (.@U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } cutin("0", 1); sleep2 5000; //Delay to hide HP Bar cutin("", 255); end; } Wow thank you it works, no error on map now! but can i ask question why the cutin are not properly working on this script? thanks. it supposed to when i attack the monster the cutin should move by the monster hp? Quote
0 Pride Posted August 12, 2022 Posted August 12, 2022 2 minutes ago, Takuyakii said: Wow thank you it works, no error on map now! but can i ask question why the cutin are not properly working on this script? thanks. it supposed to when i attack the monster the cutin should move by the monster hp? Give me more details. I have not used this script xD Quote
0 Takuyakii Posted August 12, 2022 Author Posted August 12, 2022 Just now, Pride said: Give me more details. I have not used this script xD Well this idea or script are from herc. https://board.herc.ws/topic/15975-custom-unit-hp-bar-system/ this is the script or the actual. Quote
0 Pride Posted August 12, 2022 Posted August 12, 2022 Just now, Takuyakii said: Well this idea or script are from herc. https://board.herc.ws/topic/15975-custom-unit-hp-bar-system/ this is the script or the actual. sleep2 100; -> maybe try Playing with this while (.@HP_Bar != 0) { .@U_HP = .@unitdata[UMOB_HP]; .@P_HP = (.@U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } Quote
0 Takuyakii Posted August 12, 2022 Author Posted August 12, 2022 Just now, Pride said: sleep2 100; -> maybe try Playing with this while (.@HP_Bar != 0) { .@U_HP = .@unitdata[UMOB_HP]; .@P_HP = (.@U_HP*100)/.@U_MAXHP; cutin(.@P_HP+"", 1); sleep2 100; } already did, it always showing like this it supposed to be full hp then per hit should be reduce the hp. anyway i dont know if this is about script or the client, but thank you for helping me, +1 Quote
Question
Takuyakii
Good day!
Can someone help me, to fix this error ?
buildin_getunitdata: Error in Argument! Please give a variable to store value in
Script:
refer to this link: https://board.herc.ws/topic/15975-custom-unit-hp-bar-system/
15 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.