Jump to content
  • 0

Custom Unit HP Bar System


Question

Posted
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",POPORING,1,strnpcinfo(0)+"::OnDie");
			setunitdata .mobGID,UMOB_MAXHP,4000;
			setunitdata .mobGID,UMOB_HP,4000;
		.@count = getunits(BL_PC, .@units, false, "payon");
		for (.@i = 0; .@i < .@count; .@i++)
			addtimer(0,strnpcinfo(0)+"::OnHPBar", .@units[.@i]);
	}
	end;
	
OnDie:
.HP_Bar = 0;
end;
	
OnHPBar:
.U_MAXHP = getunitdata (.mobGID,UMOB_MAXHP);
while (.HP_Bar != 0)
{
	.U_HP = getunitdata (.mobGID,UMOB_HP);
	.P_HP = (.U_HP*100)/.UMOB_MAXHP;

	cutin(""+.P_HP+"", 1);
	 
	sleep2 100;
}
cutin("0", 1);
sleep2 5000; //Delay to hide HP Bar
cutin("", 255);
end;

}

anyone can help me to correct this script..

im trying to convert this script https://herc.ws/board/topic/15975-custom-unit-hp-bar-system/ to rathena

TIA.

2 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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...