NOTE- You will need 'FPSC V-1.18 or higher' in order for this script to work.
Here is a script which will award your player with an 'Extra Life' when the player is close to a 'looping' animated model.
It's also setup to play a sound effect which you can add in the models 'FPE' file.
Many Thanks to Ched80 and BlackFox for their help.
;Artificial Intelligence Script
;Header
desc = BonusLife (Player gets a Bonus Life)
;Triggers
:state=0:state=1
:state=1:animate=1,dimvar=$PL,state=2
:state=2,plrdistwithin=50:addvar=$PL 1,playertake,plrsound=$0,state=3
;End of Script
EDIT - Here is an example of the 'FPE' setup.
;Entity Spec
;Created by: EXAMPLE FPE FILE
;Header
desc = Bonus Pickup
;ai
aiinit = appear1.fpi
aimain = User\BonusLife.fpi
aidestroy = disappear1.fpi
;spawn
spawnmax = 0
spawndelay = 0
spawnqty = 0
;orientation
model = meshbank\User\Bonus Model.x
offx = 0
offy = 45
offz = 0
rotx = 0
roty = 0
rotz = 0
scale = 100
fixnewy = 0
defaultstatic = 0
materialindex = 1
collisionmode = 1
strength = 0
isimmobile = 1
soundset = audiobank\User\Bonus SFX.wav
soundset1 =
;visualinfo
textured = texturebank\User\Bonus_D2.dds
effect =
castshadow = 0
;Animationinfo
animmax = 2
anim0 = 0,0
anim1 = 0,59