Blockland Forums > Modification Help
Editing MaxHealth through Client
(1/3) > >>
Mapster:
So what I want to do is change the Max Health of the player. The way my script is supposed to work is when the player gets 1000 of the variable Exp he will gain 10 health bringing it to 110. Now I want to know what I need to edit in my code for it to work.

I'm no pro coder when it comes to messing with VCE through code so here's my failed attempt.

--- Code: ---function VCE_ifVariable(Exp : 1000)
{
maxDamage = 110;
};
--- End code ---

Now what am I doing wrong.
Amade:
You would need to create a new datablock to increase the player's max health. Further, this isn't possible through events alone.
Mapster:
Ok I know how to use a make a Datablock with a different Max Health but how do I make it so when I get 1000 of the variable Exp to change the Datablock to what I want?
Amade:

--- Code: ---function AddVariableAmount(%player, %amount)
{
%player.variable = %player.variable + %amount;
if(%player.variable >= 1000)
{
%player.changeDatablock(HigherMaxHealthDatablock);
}
}
--- End code ---
Mapster:
Besides changing the (HigherMaxHealthDatablock) to my datablock, what else do I need to add or change?
Navigation
Message Index
Next page

Go to full version