Author Topic: Editing MaxHealth through Client  (Read 1309 times)

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: [Select]
function VCE_ifVariable(Exp : 1000)
{
maxDamage = 110;
};

Now what am I doing wrong.

You would need to create a new datablock to increase the player's max health. Further, this isn't possible through events alone.

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?

Code: [Select]
function AddVariableAmount(%player, %amount)
{
%player.variable = %player.variable + %amount;
if(%player.variable >= 1000)
{
%player.changeDatablock(HigherMaxHealthDatablock);
}
}
« Last Edit: October 02, 2011, 11:02:26 PM by Amade »

Besides changing the (HigherMaxHealthDatablock) to my datablock, what else do I need to add or change?
« Last Edit: October 02, 2011, 10:24:39 PM by Mapster »

Using different datablocks is a bad idea if you want to have a lot of levels, as you'd need to create a lot of datablocks

I recommend something like this

Code: [Select]
package fakeMaxHP
{
    function Player::damage(this,%obj,%pos,%damage,%damageType)
    {
        %damage = %damage / (%this.client.fakeMaxHP / 100);
        Parent::damage(%this,%obj,%pos,%damage,%damageType);
    }
};
ActivatePackage(fakeMaxHP);



How could I combine that with the code for having a required variable for it to work?

Sounds like this guy just wants to cheat on servers by having more health then everyone else.

Sounds like this guy just wants to cheat on servers by having more health then everyone else.

Wow if you had even read my earlier posts you would know thats not true. Besides this script would only work on my server anyway, don't post useless comments.

Wow if you had even read my earlier posts you would know thats not true. Besides this script would only work on my server anyway, don't post useless comments.
What about the title then?
Quote from: Topic Subject
Editing MaxHealth through Client

Oh, I think he wants to change his health clientside, which is impossible.

No no no, I want it so when I get a certain number of a certain variable so that it will change my datablock to a datablock with more health than the default.

Read previous posts >.>

Sorry if title is misleading

Code: [Select]
function AddVariableAmount(%player, %amount)
{
%player.variable = %player.variable + %amount;
if(%player.variable >= 1000)
{
%player.changeDatablock(HigherMaxHealthDatablock);
}
}


Isn't this what you want. Maybe use crab head and this together.

Yeah thats what I want but I was asking what do I change other than the HigherMaxHealthDatablock?