GRAWP001 REALNAME -Rha-System-HeartPiece IMAGE - SCRIPT if (playerenters) { toweapons -Rha-System-HeartPiece; } if (playerchats && strequals(#c,/remove-system) && isweapon) { hideimg 210; destroy; } if (playerhurt) { this.draw=1; timeout=0.05; } if ((created || playerenters) && isweapon && this.init==0) { this.init=1; if (strlen(#s(System_Hearts))==0) { setstring System_Hearts,0; setstring System_Hearts_Found,000000000000000000000000000000000000000000000; } this.heart_pieces=5; this.heart_size={20,20}; this.screen_old={screenwidth,screenheight}; this.items={playerhearts,strtofloat(#s(System_Hearts))}; this.draw=1; DrawHeartPiece(); timeout=0.05; } if ( playerenters && isweapon ) { this.draw=1; timeout=0.05; } if (timeout && isweapon) { if (strequals(#m,maps1) || strequals(#m,maps2) || strequals(#m,rha_swim_maps2)) { hideimg 210; this.draw=1; } else { if ( imgwidth(rha_system_heartpiece.png) == 0 ) this.draw=1; if ( this.screen_old[0] != screenwidth || this.screen_old[1] != screenheight ) { this.screen_old={screenwidth,screenheight}; this.draw=1; } if ( playerhearts != this.items[0] ) this.draw=1; this.items[0]=playerhearts; if ( strtofloat(#s(System_Hearts)) != this.items[1] ) { this.items[1]=strtofloat(#s(System_Hearts)); this.draw=1; } if ( this.draw == 1 ) { DrawHeartPiece(); if (this.items[1] >= this.heart_pieces) { disabledefmovement; setani idle,; for ( this.i=0; this.i<(this.heart_pieces+1); this.i++ ) { sleep 0.1; changeimgpart 210,this.i*this.heart_size[0],this.heart_size[1],this.heart_size[0],this.heart_size[1]; } lay2 fullheart,playerx+0.5,playery+1; sleep 0.4; enabledefmovement; setstring System_Hearts,#v(strtofloat(#s(System_Hearts))-this.heart_pieces); this.items[1]=strtofloat(#s(System_Hearts)); } } } timeout=0.05; } function DrawHeartPiece() { showimg 210,rha_system_heartpiece.png,screenwidth-(this.heart_size[0]*2),screenheight-(this.heart_size[1]*3); changeimgpart 210,this.items[1]*this.heart_size[0],0,this.heart_size[0],this.heart_size[1]; changeimgvis 210,4; } SCRIPTEND