HI there,
Someone else is having trouble with the script command
g_Entity[e]['health'] and with the player start direction. (
This script that
worked well before but does not work with the Last Updated 18/5/15.
The problem appears in the state[e] == 2, It seems that the motive is associated with the command
g_Entity[e]['health']
local state={}
local health = {}
local life={}
function botrele_init(e)
state[e] = 0
end
function botrele_main(e)
if state[e] == 0 and g_Entity[e]['activated'] ==0 then
SetEntityHealth(e,1000)
end
if state[e] == 0 and g_Entity[e]['activated'] == 1 then
ActivateIfUsed(e)
SetEntityHealth(e,1000)
SetActivated(e,0)
state[e] = 1
SetAnimation(0);
PlayAnimation(e);
PlaySound(e,0);
end
if state[e] == 1 and GetAnimationFrame(e) > 9 then
SetAnimation(1);
state[e] = 2
radiation = 1
end
-- it has now stopped working
if state[e] == 2 then
life[e] = g_Entity[e]['health']/10
health[e] =110- (g_Entity[e]['health']/10)
SetAnimationFrame(e,health[e])
PromptLocal(e," LIFE% ".. life[e])
if g_Entity[e]['health'] <= 0 then
ActivateIfUsed(e)
radiation = 0
state[e] = 3
PlaySound(e,1);
SetAnimation(2);
PlayAnimation(e);
CollisionOff(e)
end
end
end
I think the problem lies in the fact that the script is not able to obtain the health of the entity through the
g_Entity[e]['health']
Someone else have this problem?
Thanx a lot for your time.