I don't understand why this code doesn't work as it is correctly coded
local state = ""
function lootbox_init(e)
state = "wait"
end
function lootbox_main(e)
if g_Entity[e]['activated'] > 0 and state == "wait" then
if g_Entity[e]['animating'] == 0 then
SetAnimationFrames(1,30)
LoopAnimation(e)
state = "1"
end
end
end
This is my FPE file
;Saved by FPSCR Object Importer v1.000
;header
desc = lootbox
;visualinfo
textured = blankTex.png
effect = effectbank\reloaded\entity_basic.fx
castshadow = 0
transparency = 0
;orientation
model = lootbox.dbo
offx = 0
offy = 0
offz = 0
rotx = 0
roty = 0
rotz = 0
scale = 1215
collisionmode = 0
defaultstatic = 1
materialindex = 0
matrixmode = 0
cullmode = 0
;physics shapes
physicscount = 1
physics0 = "0,1.98840796947,2.02516222,1.95759057999,5.72080771644e-10,-0.431906461716,-0.028793765232,0,0,0"
;identity details
ischaracter = 0
hasweapon =
isobjective = 2
cantakeweapon = 0
;statistics
strength = 25
explodable = 0
debrisshape = 0
;ai
aimain = default.lua
;spawn
spawnmax = 0
spawndelay = 0
spawnqty = 0
;anim
animmax = 2
animOpen = 1,70
Why should it not play when we tell what are the animations frames range and call LoopAnimation ?
Why should it be more complicated than that ?