Page 1 of 1

problem whit variable

PostPosted: Fri Jul 10, 2009 3:33 pm
by qwertiope31
my actor cant die

I create an actor player an actor enemy and a variable hp
I put this scipt

scipt editor: player -> create actor
int hp = 7;

script editor: player -> collision (any side of enemy)
hp = hp - 7;
if (hp=0)
{

DestroyActor("vie");
DestroyActor("vie");

}

Re: problem whit variable

PostPosted: Fri Jul 10, 2009 3:38 pm
by Kalladdolf
qwertiope31 wrote:if (hp=0)

You need to write:
Code: Select all
if(hp == 0)

Re: problem whit variable

PostPosted: Fri Jul 10, 2009 4:15 pm
by qwertiope31
ok tanks

Re: problem whit variable

PostPosted: Fri Jul 10, 2009 4:20 pm
by qwertiope31
dont work

Re: problem whit variable

PostPosted: Fri Jul 10, 2009 4:27 pm
by qwertiope31
script editor: collision -> (any side of enemy)
hp = hp - 7;
if (hp == 0)
{

DestroyActor("player");
DestroyActor("player");

}



scipt editor: player -> create actor
int hp = 7;

and I have my actor player and enemy and my variable hp what is the problem

Re: problem whit variable

PostPosted: Fri Jul 10, 2009 4:28 pm
by jimmynewguy
ummm idk try
if(hp<=0)
and make sure it's an actor variable
and make sure the actor is spelled right

Re: problem whit variable

PostPosted: Fri Jul 10, 2009 4:29 pm
by Kalladdolf
Try one more thing: On "Create Actor" just put "hp = 7;"
And create a hp variable with the tools provided by Game Editor.
In order to do so, hit the "Variables" button in the script editor.
Then click "Add". Name it and make it an actor variable.

Re: problem whit variable

PostPosted: Fri Jul 10, 2009 4:38 pm
by qwertiope31
that work tanks