The script isn't that complete.
You will need to alter some of it to suit your need.
And the script is in .sqs format (to which people said 'old')
Also,keep in mind that the zombie may not follow you if you get inside buildings (Just thinking)
Sometimes,they don't follow you if you are in shallow water,too.
I recommend you ask someone to convert it to .sqf format as this one may cause lag if you used this for more than 100 zombies.(not sure whether it will cause lag with your machine though,I have got a low-end CPU,maybe that's the cause of it)
GLuck,
Haroon1992
EDIT :
Sorry,mathias...
That script I gave you is still not working with the light
Here is the fix.......
(You know,I kept creating and tweaking that example mission,I even added sound!!!!!
It's gonna like a real mission rather than an example mission....
The mission is still unfinished,I'll attach it this evening)
Here is the scipt (seems complicated,but its me who sloppily commented that the script looks like a mess)
_zombieman=_this select 0;
_tobefollowed=_this select 1;
_lightobject=_this select 2;
_homey=_this select 3;
_fleetimelimit=_this select 4
_feardis=_this select 5;
_additionalcondition=_this select 6;
_fleetime=0
;syntax = [_zombieman,_tobefollowed,_lightobject,_homey,fleetimelimit,_feardis] exec "zombies.sqs"
;syntax explanations
;_zombieman - name of zombie
;_tobefollowed - player name or the person's name(victim)
;_lightobject - the name of the object that the zombies afraid of,you can set anything here,like
; a chopper or a truck,which the zombies will become afraid of and run away from that thing
;_homey - place to where zombies will flee,when they encounter "object" OR "thing"
;this can be anything from a graveyard to forests.
;_fleetimelimit - the time in seconds,which starts when the zombie encounter _lightobject,
;after the desired time,the zombie will return back to player.
;should be more than 10 seconds,use the RANDOM command here to make it more dynamic
;the zombie will fight back the player when returning home,if he gets too close to the zombie
;_feardis - the distance between ZOMBIE and _lightobject,at which the ZOMBIE will become afraid of _lightobject
;and return back to _homey,use min value + random value here to make it dynamic.
;_additionalcondition - an additional condition for the zombie to flee,for example,the zombie only flees when
;the searchlight is manned / turned on
;EG SYNTAX
;[zombienimble1,player,searchlight1,home1,15+random 10,50,!(isNil gunner searchlight1)] exec "haroonzombiescript.sqs"
;exp > zombienimble1 chases player until it saw searchlight1 (GAMELOGIC'ED OR MANNED) from 50m distance,zombienimble then fleed away
;to his grave,home1,on the way to home, after a min of 15 seconds,zombienimble changed his mind and return back to
;player instead of going to home1
; HAVE A GOOD TIME WITH THIS SCRIPT
#zombieloop
? not (ALIVE _zombieman) : exit
? not (ALIVE _tobefollowed) : goto "deadplayer"
_zombieman setbehaviour "CARELESS";
_zombieman setspeedmode "LIMITED";
? _zombieman distance _lightobject > _feardis : _zombieman domove getpos _tobefollowed
?_zombieman distance _lightobject < _feardis AND _additionalcondition : goto "goawayzombies"
?_zombieman distance _tobefollowed < 2 : goto "zombiebite"
~0.5
goto "zombieloop"
;======================================================================
#zombiebite
_randanim=round random 2
?_randanim<1.5 : _animname="AwopPercMstpSgthWpstDnon_Part3"
?_randanim > 1.5 : _animname="AmovPercMrunSnonWnonDf_AmovPercMstpSnonWnonDnon_gthStart"
;checks to make sure player is still around zombie
?_zombieman distance _tobefollowed < 3 : _zombieman dowatch _tobefollowed;_zombieman switchmove _animname
~1
;the animation used here is for ARMA and is a Grenade Throwing animation,which looked like a scratching zombie
;checks again to ensure that player is still near zombie to avoid being scratched even when he's away from zombie
? _zombieman distance _tobefollowed < 3 : _tobefollowed setdammage getdammage _tobefollowed + 0.3
~2
hint format ["%1",getdammage _tobefollowed]
;damages the player if he catches the scratch,the damage value is 0.3,so four scratches and the player is dead
goto "zombieloop"
;=====================================================================
#deadplayer
_zombieman domove getpos _tobefollowed
;zombie moves to victim when its dead
;--------------------------------------------------
@_zombieman distance _tobefollowed < 4
;waituntil zombie gets to 4m distance from victim
;--------------------------------------------------
_zombieman setpos [(getpos _tobefollowed select 0)+(random 2+random -2),(getpos _tobefollowed select 1)+(random 2+random -2),0]
~1.5
_zombieman switchmove "AinvPknlMstpSlayWrflDnon_healed2"
~3
_zombieman switchmove "AinvPknlMstpSlayWrflDnon_healed2"
~4
_zombieman action ["HIDEBODY",_tobefollowed]
;position zombie randomly around player and then perform an eating animation
;ONCE THE ZOMBIE FINISHES EATING THE DEAD,THE BODY WILL SINK INTO THE GROUND
;If you don't want that,just remove this line
;_zombieman action ["HIDEBODY",_tobefollowed]
;haroon : SOUND is added in the EXAPLE MISSION (which will be posted this evening)
;sounds are to be added via description.ext
;=========================================================================
EXIT
;GO AWAY ZOMBIES
#goawayzombies
_zombieman setspeedmode "NORMAL"
?_fleetime==_fleetimelimit : goto "zombieloop"
_fleetime=_fleetime + 0.5
_zombieman domove getpos _homey
~2
;CHECKs
? NOT (ALIVE _zombieman) : exit
? _tobefollowed distance _zombieman < 3 : goto "zombiebite"
? _tobefollowed distance _zombieman < 5 AND _zombieman distance _lightobject > _feardis : goto "zombieloop"
;exp of above line :
;if VICTIM is within 5M from ZOMBIE and ZOMBIE is farer to the FEARSOME OBJECT (> _FEARDIS),THEN goto to ZOMBIELOOP
;which will make the ZOMBIE turn back from going to HOME and chase the VICTIM again
goto "goawayzombies"
:CREDITS
:Haroon1992 (me,beginner scriptor who writes crappy scripts :D)
;mathias_eichinger (for his idea about zombie script)
EXIT