#library "LastResort.acs"
#include "zcommon.acs"
script "LastResortItem" OPEN
{
int IfHealth = GetActorProperty(1000, APROP_Health);
delay(1);
UNTIL (IfHealth << 1)
{
if (CheckActorInventory(1000, "LastResort"))
SetActorProperty(1000, APROP_Health, 50);
TakeActorInventory(1000, "LastResort", 1);
}
}
Hey guys, I'm trying to make a script for an item that prevents you from dying by setting your health back up to 50 when you get below 1 health. But I get the message "Script LastResortItem Terminated" when I'm testing it out ingame.
So the script "works" so far as I can launch the game and all that. It just terminates because there's an infinite loop somehow, but I don't see it cos I dont have coder eyes. Please help :D
Question
Wo0p
#library "LastResort.acs" #include "zcommon.acs" script "LastResortItem" OPEN { int IfHealth = GetActorProperty(1000, APROP_Health); delay(1); UNTIL (IfHealth << 1) { if (CheckActorInventory(1000, "LastResort")) SetActorProperty(1000, APROP_Health, 50); TakeActorInventory(1000, "LastResort", 1); } }
Hey guys, I'm trying to make a script for an item that prevents you from dying by setting your health back up to 50 when you get below 1 health. But I get the message "Script LastResortItem Terminated" when I'm testing it out ingame.
So the script "works" so far as I can launch the game and all that. It just terminates because there's an infinite loop somehow, but I don't see it cos I dont have coder eyes. Please help :D
Edited by Wo0pShare this post
Link to post
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.