thanks for your reply
what im trying to do is when i have collected a certain number of acorns the lazers blocking entry to level 2 will disappear.
the entity is called killer.wmb
it wont disappear
can u help
here is the code below
entity* killer_ent;
DEFINE PickUp_Type,skill1; // 1=HEALTH, 2=ACORNS,
Function pick_up_event()
{
if(EVENT_TYPE == event_impact)//if the player walks into the entity then .......
{
if (int(you.ACORNS) == 1)
{
ent_remove(killer_ent);
}
if (my.pickup_type == 1) // HEALTH pickup
{
If ( int(you.HEALTH_MAX) < 100) // if my MAX_HEALTH is less than a 100
{
if ( int(you.HEALTH) + 20 > 100) // if i add 75 to your health and it goes over 100 then just give me 100
{
you.HEALTH = 100; //then i am fully healed
}
else /// just add 75 to the HEALTH if it is below 24
{
you.HEALTH += 20;
}
ent_remove(my); //remove entity
}
}
else{
if (my.pickup_type == 2) // ACORNS pickup
{
If ( int(you.ACORNS_MAX) < 100) // if mer MAX_ACORNS is less than a 100
{
if ( int(you.ACORNS) + 1 > 100) // if by adding 1 acorn brings it to over 100 just give me 100
{
you.ACORNS = 100; //then me have full ACORNS
}
else // just add 1
{
you.ACORNS += 1;
if (int(you.ACORNS) > 99)//if acorns is greater than 99
{
you.LIVES += 1;//add 1 life
you.ACORNS = 0; //reset acorn counter
}
}
ent_remove(my); // remove entity
}
}
}
}
}
//uses: PickUp_Type
Action pick_up
{
my.enable_impact = on;//turn on entity impact
my.event = pick_up_event;//when it happens call the pick_up_events function
}