@ The Shooter
Sorry about the delay. Using huds is a bit tricky,as I am finding.
The best working method I have found is to use an invisible entity to display the message/hud near the player's start position to tell the that "friendly fire is not tolerated".
I used the switch from the sci fi/wall entities.
Save this file to the scriptbank and use it as the main fpi for the switch. I called it 'switch5'.
;Artificial Intelligence Script
;Header
desc = displays message hud only
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\restart.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=100:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=10:none
;End of Script
Use this script as the appear script for the switch ('appear3')
;Artificial Intelligence Script
;Header
desc = invisible
;Triggers
:state=0:state=1,setalphafade=0,coloff,runfpidefault=1
;End of Script
I used a portion of the ally script we made to make this 'dontshoot' script.
;artificial intelligence script
;desc =ally follow script
;this ally script makes the ally fully automated, no keyboard commands
;this next section does the work to monitor the entity's health
:always:globalvar=45
:healthless=80,activated=0:setvar=1,activate=1,state=20
:healthless=60,activated=1:setvar=1,activate=2,state=20
:healthless=40:quitgame
;------------------------------------------
:state=0:state=16
:state=1,plrdistfurther=60,plrcanbeseen:lookatplr,rotatetoplr,resethead,settarget,animate=5,movetotarget
:state=1,plrdistfurther=60,plrcannotbeseen:state=10
:state=1,plrdistwithin=61:freeze,animate=1,state=2
:state=2:timerstart,rotatehead=10,state=3
:state=2,plrdistfurther=70:state=10
:state=3,timergreater=2000:state=4
:state=3,plrdistfurther=70:state=10
:state=4:timerstart,state=5
:state=4,plrdistfurther=70:state=10
:state=5,timergreater=2000:rotatehead=-30,timerstart,state=6
:state=5,plrdistfurther=70:state=10
:state=6,timergreater=2000:rotatehead=30,state=4
:state=6,plrdistfurther=70:state=10
:state=10:lookatplr,rotatetoplr,resethead,state=11
:state=11,plrcanbeseen:settarget,state=1
:state=11,plrcannotbeseen:lookatplr,rotatetoplr,resethead,state=12
:state=12,plrcanbeseen:settarget,state=1
:state=12,plrcannotbeseen:movetotarget,state=13
:state=13,reachtarget:animate=1,state=10
:state=13:state=10
:state=16:animate=31,state=17
:state=17:state=18
:state=18,plrcanbeseen:state=10
;this section does the dirty work of killing the player
:state=20:state=21,timerstart
:state=21,timergreater=1000:state=22
:state=22:setvar=0,state=23
:state=23:state=1,plraddhealth=-500
The sections of this script I made note of can be put in any script (as long as the state value of said script does not include 20-23).
I tested this using the ww2 colt 45 which does 25 points of damage per shot. If the player shoots the 'innocent' once it causes death (back to the start or last checkpoint). Shoot the same entity again, death again. The third shot to the same entity quits the game.
Already tested. Enjoy.
(\__/)
(O.o )
(> < ) This is your bunny on drugs.