Ok i tried to add this to one of my imp scripts with the idea that basically he would do the same as the first script = fly away and blow up
this is the script to animate the imp
impanim= {}
function sdance_init(e)
SetAnimation(0)
impanim[e] = 0
end
function sdance_main(e)
if impanim[e] == 0 then
impanim[e] = 1
SetAnimationFrames(1,116)
LoopAnimation(e)
end
function sdance_exit(e)
g_kills = g_kills + 1
g_coins = g_coins + math.random(1 , 5)
end
end
what happens is either the Imp doesn't animate and does fly away or will animate and wont fly away lol is this because of the imp using animations or just that i haven't got it right?
this is the combined script that animates just doesnt fly away etc
impanim= {}
local launch = 0
local delay = 3000
function imp_launcher_init(e)
SetAnimation(0)
impanim[e] = 0
end
function imp_launcher_main(e)
if impanim[e] == 0 then
impanim[e] = 1
SetAnimationFrames(1,116)
LoopAnimation(e)
if g_Entity[e]['health'] < 200 and launch == 0 then
impanim[e] = 0
StopAnimation(e)
-- ActivateIfUsed(e)
if GetTimer(e) >= delay then
launch = 1
PlaySound(e,0)
end
else
StartTimer(e)
end
if launch == 1 then
CollisionOff(e)
StartParticleEmitter(e)
MoveUp(e,500)
RotateX(e,600)
RotateZ(e,400)
RotateY(e,300)
if x == x then
MoveForward(e,1000)
end
if GetPlayerDistance(e) > 3000 then
SetEntityHealth(e,0)
Destroy(e)
CollisionOn(e)
StopSound(e,0)
StopParticleEmitter(e)
end
end
end
end
lol no worries had an end in the wrong place
and finally swapped out the Destroy (e) for an exit and......
lol heres the script you just need to change the animation frame to suit your character
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
XFX R5 2gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel
I only smile because i have absolutely no idea whats going on