destroy player one if health = 0

Ideas for Game Editor evolution.

destroy player one if health = 0

Postby Zehper48 » Tue Jun 27, 2006 8:39 pm

how can i do this
if (text)health = 0 destroy player1
i need some code, i have searched the forums but couldnt find anything that helped. it would help if you could give me step by step
I like score
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby makslane » Tue Jun 27, 2006 8:56 pm

Try this:

Code: Select all
if(health <= 0)
{
   DestroyActor("player1");
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Zehper48 » Tue Jun 27, 2006 9:24 pm

its not working. it says unknown type in binhconst, possible non relational operation and, undefined for relational operation :(
I like score
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby makslane » Tue Jun 27, 2006 10:50 pm

Do you have a variable health?
If not, create in the Variables panel, as actor, integer.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Zehper48 » Wed Jun 28, 2006 1:07 am

I have a text actor i named health
i know how to make the health go down but i dont know how to destroy it only when it reaches 0 or lower.
I like score
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

Postby makslane » Wed Jun 28, 2006 1:19 am

Use:

Code: Select all
if(health.textNumber <= 0)
{
   DestroyActor("player1");
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Zehper48 » Wed Jun 28, 2006 1:59 pm

Yes it worked :D . Thank you soo much
I like score
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron