I have the flying insect Wasp and he is basically able to attack me but I can't do any damage to him. Editing the insectflying script I did not see anything showing he could take damage. I also have the crawling hand and it can be killed so I looked at it's script and see this at the end of the script
function hand_exit(e)
StopAnimation(e)
StopSound(e,0)
Destroy(e)
end
I added that to end of the flying insect script but I still can't do any damage to the Wasp. Here is the entire script if anyone can see how to fix this sure would appreciate it )
local attack_delay = {}
rotation = {}
flying = {}
attacking = {}
stinging = {}
vertmovement = {}
w_animating = {}
maxvolume = {}
minvolume = {}
noise = {}
nvolume = {}
function insectflying_init(e)
attack_delay[e] = 250
rotation[e] = 0
flying[e] = 1
attacking[e] = 0
stinging[e] = 0
vertmovement[e] = 0
w_animating[e] = 0
SetSoundVolume(100)
maxvolume[e] = 100
minvolume[e] = 1
noise[e] = 0
nvolume[e] = 0
end
GravityOff(e)
function insectflying_main(e)
--PlayerDist = GetPlayerDistance(e)
rotation[e] = math.random(-200,200)
vertmovement[e] = math.random(-50,50)
nvolume[e] = maxvolume[e] - ( GetPlayerDistance(e) / 100.0 )
if nvolume[e] < minvolume[e] then
StopSound(e,0)
noise[e]=0
else
if noise[e] == 0 then
LoopSound(e,0)
noise[e] = 1
end
SetSoundVolume(nvolume[e])
end
if stinging[e] == 0 and g_Entity[e]['animating'] == 0 then
SetAnimationFrames(1,2)
LoopAnimation(e)
g_Entity[e]['animating'] = 1
end
if stinging[e] == 0 and w_animating[e] == 1 then
StopAnimation(e)
end
if GetPlayerDistance(e) < 71 then
flying[e] = 0
attacking[e] = 0
stinging[e] = 1
end
if GetPlayerDistance(e) < 500 and GetPlayerDistance(e) >70 then
flying[e] = 0
attacking[e] = 1
stinging[e] = 0
end
if GetPlayerDistance(e) > 500 then
flying[e] = 1
attacking[e] = 0
stinging[e] = 0
end
if flying[e] == 1 then
MoveForward(e,100)
if g_Entity[e]['y'] < 1000 and g_Entity[e]['y'] > 700 then
MoveUp(e,vertmovement[e])
elseif g_Entity[e]['y'] > 1000 then
MoveUp(e,-20)
elseif g_Entity[e]['y'] < 700 then
MoveUp(e,20)
end
RotateY(e,rotation[e])
elseif attacking[e] == 1 then
MoveForward(e,100)
MoveUp(e,vertmovement[e])
if g_Entity[e]['y'] > g_PlayerPosY then
MoveUp(e,-20)
elseif g_Entity[e]['y'] < 650 then
MoveUp(e,20)
end
RotateToPlayer(e)
elseif stinging[e] == 1 then
MoveForward(e,100)
RotateToPlayer(e)
if w_animating[e] == 0 then
StopAnimation(e)
w_animating[e] = 1
end
if w_animating[e] == 1 then
if g_Entity[e]['animating'] == 0 then
SetAnimationFrames(5,14)
LoopAnimation(e)
g_Entity[e]['animating'] = 1
end
end
if GetTimer(e) > attack_delay[e] then
HurtPlayer(e,1)
attack_delay[e] = GetTimer(e) + 250
end
end
function insectflying_exit(e)
StopAnimation(e)
StopSound(e,0)
Destroy(e)
end
end