Posted By: Master_Jiuro
Pickup item in 3rd person view - 05/24/09 09:47
Hello! I tried and tried, but could not figure it out. I have an item and when I click it with my mouse, the player model should play a pickup animation and the clicked item should be removed. Here is what I have:
The result of that code is:
-) Item is removed
-) nothing else
So please, help my model to be animated
Thanks in advance!!!!
Quote:
function play_pickup_anim //Animation for the player model
{
player.skill23 = 0;
while (player.skill23 < 90)
{
ent_cycle("Pickup", player.skill23);
player.skill23 += 3 * time;
wait (1);
}
}
action sword //Action assigned to the item
{
my.shadow = on;
c_setminmax(me);
if(mouse_ent == me && mouse_left)
{
if(!sword)
{
sword = 1;
}
else
{
sword_count += 1;
}
}
wait(1);
}
play_pickup_anim();
ent_remove(me);
}
{
player.skill23 = 0;
while (player.skill23 < 90)
{
ent_cycle("Pickup", player.skill23);
player.skill23 += 3 * time;
wait (1);
}
}
action sword //Action assigned to the item
{
my.shadow = on;
c_setminmax(me);
if(mouse_ent == me && mouse_left)
{
if(!sword)
{
sword = 1;
}
else
{
sword_count += 1;
}
}
wait(1);
}
play_pickup_anim();
ent_remove(me);
}
The result of that code is:
-) Item is removed
-) nothing else
So please, help my model to be animated
Thanks in advance!!!!