Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script "fearMonitor" (int threshold, int maxFear, int fallOff, int checkRate)
- {
- int currentFear = 0;
- while(true)
- {
- //Get how afraid we are
- currentFear = CheckActorInventory(0, "FearToken");
- //Make sure we haven't passed the maximum fear level
- if(currentFear > maxFear)
- {
- //Adjust the fear level to the max if we exceeed it
- TakeActorInventory(0, "FearToken", currentFear - maxFear);
- }
- //If we're too afraid but not already running away, run
- if(currentFear >= threshold && !CheckActorInventory(0, "Afraid"))
- {
- GiveActorInventory(0, "Afraid", 1);
- SetActorState(0, "Fear");
- }
- //Reduce our fear level by fallOff
- TakeActorInventory(0, "FearToken", fallOff);
- delay(checkRate);
- }
- }
- ---------------------------------------
- Spawn:
- TNT1 A 0
- POSS A 1 ACS_NamedExecuteWithResult("fearMonitor", 2, 5, 1, 1)
- Look:
- POSS A 10 A_Look
- TNT1 A 0 A_TakeInventory("PossFireSignal", 0)
- POSS B 10 A_Look
- TNT1 A 0 A_TakeInventory("PossFireSignal", 0)
- Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement