Page 1 of 2

help with destroying actors please

PostPosted: Mon Feb 19, 2007 5:14 pm
by mr-game
i want to make it so when you hit the spikes he dies within 3 hits
i tryed making lives in numbers and i got it so when it hits it goes down one till 00 but i want it so when the lives reaches 00 the player dies ive tryed everything please help

plus i made it so when the actor hits the spikes he goes transparant but how do i make it so he cant get hurt while transparant

PostPosted: Mon Feb 19, 2007 5:40 pm
by Sgt. Sparky
okay,
first make an actor Var called Health.
on the create actor Event of you player:
Code: Select all
Health = 99;

or whatever you want it to be.
on the colliison of the spikes:
Code: Select all
Health -= 33;

and on the draw actor event of the player:
Code: Select all
if (health == 0)
{
   DestroyActor("Event Actor");
}
if (health < 0)
{
   DestroyActor("Event Actor");
}

:D
I hope that helps!

a reply

PostPosted: Wed Feb 21, 2007 10:24 pm
by mr-game
A reply

that didnt work for me its probly me and im so dumb i missed out somthing realy realy stupid but it didnt work just came up with aload of random things wronge and wouldnt let me play game coz there is errors in the script or somthing like that and im so anoyed coz i realy want to make this game and i made this reply last much longer than it had to be but i dont think anyone will care coz im stupid if that makes sence and no one els will reply knowing my luck
the end
wrote by mr-game

PostPosted: Thu Feb 22, 2007 12:01 am
by DilloDude
Sgt. Sparky wrote:
Code: Select all
if (health == 0)
{
   DestroyActor("Event Actor");
}
if (health < 0)
{
   DestroyActor("Event Actor");
}


That should be:
Code: Select all
if (Health == 0)
{
   DestroyActor("Event Actor");
}
if (Health < 0)
{
   DestroyActor("Event Actor");
}

also, you can simplify it:
Code: Select all
if (Health <= 0)
{
   DestroyActor("Event Actor");
}

Make sure instead of 'Health' you put the name of your variable.

PostPosted: Thu Feb 22, 2007 1:56 am
by Sgt. Sparky
or it could be:
Code: Select all
if(Health < 1)
{
    DestroyActor("Event Actor");
}

:D

PostPosted: Thu Feb 22, 2007 2:23 am
by morcior
Code: Select all
if (Health<1) DestroyActor("Event Actor");


8)

PostPosted: Thu Feb 22, 2007 2:33 am
by Sgt. Sparky
morcior wrote:
Code: Select all
if (Health<1) DestroyActor("Event Actor");


8)

Bah,
can we just stop it,
:D
it is getting to be more of a competition,
I want to quit while I'm in the lead :P


8)

PostPosted: Thu Feb 22, 2007 3:41 pm
by morcior
i won :P

PostPosted: Thu Feb 22, 2007 3:44 pm
by Sgt. Sparky
No I won. :P


MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE!MINE! :x









:D

PostPosted: Fri Feb 23, 2007 12:37 am
by Game A Gogo
Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME WON!!!

PostPosted: Fri Feb 23, 2007 1:24 am
by Sgt. Sparky
Game A Gogo wrote:
Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME LOST!!!
Game A Gogo wrote:
Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME LOST!!!
Game A Gogo wrote:
Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME LOST!!!
Game A Gogo wrote:
Code: Select all
if(Health<=0)DestroyActor("Event Actor");


>..>

ME LOST!!!




I won!!! :D

PostPosted: Fri Feb 23, 2007 1:33 am
by UltimatHedgehog
sparky went crazy

P.S. sparky can you explain what you said on the health thing to me

PostPosted: Fri Feb 23, 2007 1:36 am
by Sgt. Sparky
wich part?
there is alot of it! :lol:

PostPosted: Fri Feb 23, 2007 1:37 am
by UltimatHedgehog
read it i asked a few things you only put 1 post anyway

PostPosted: Sat Feb 24, 2007 10:19 pm
by Sgt. Sparky
well, wich part do you not understand?
:D