Jump to content

Photo

Start with same hearts when continuing


  • Please log in to reply
5 replies to this topic

#1 Blackpaintbowser

Blackpaintbowser

    Go Bowser Go

  • Members
  • Location:somewhere in the world

Posted 19 January 2023 - 11:25 PM

I wish for the script in Isle of rebirth that makes it so when you continue your hearts are the same as before instead of healing


  • Twilight Knight likes this

#2 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 21 January 2023 - 05:43 PM

I haven't tested it, but this should work:

int hero_hp = 0;

global script Active {
    void run(){
		while(true){
			hero_hp = Hero->HP;
			
			Waitdraw();
			
			Waitframe();
         }
    }
}

global script onContGame 
{
	void run()
	{
		// Fully heal when the Hero died
		if (!hero_hp) {
			Hero->HP = Hero->MaxHP;
		} else {
			Hero->HP = hero_hp;
		}
	}
}

  • Blackpaintbowser likes this

#3 Blackpaintbowser

Blackpaintbowser

    Go Bowser Go

  • Members
  • Location:somewhere in the world

Posted 21 January 2023 - 07:20 PM

It works perfectly except when you save it heals you I just copied the last part as a Onsaveload script and now it works


Edited by Blackpaintbowser, 21 January 2023 - 07:29 PM.


#4 Emily

Emily

    Scripter / Dev

  • ZC Developers
  • Pronouns:She / Her

Posted 21 January 2023 - 10:21 PM

It works perfectly except when you save it heals you I just copied the last part as a Onsaveload script and now it works

An 'onSaveLoad' will not run when you F6->Continue, so F6->Continue would still heal you.

...really, you need to put the script in BOTH onSaveLoad AND onContGame.


  • Twilight Knight likes this

#5 Blackpaintbowser

Blackpaintbowser

    Go Bowser Go

  • Members
  • Location:somewhere in the world

Posted 21 January 2023 - 11:30 PM

That's what I did



#6 Twilight Knight

Twilight Knight

    Tell all with glee, Argon's on PureZC

  • Members
  • Real Name:Sven
  • Location:Rotterdam, NL

Posted 22 January 2023 - 08:36 AM

Glad it works!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users