Hey guys figured I would check in. Im still having a strange issue where events are still being run on the animationevent for the zombie but the client is unable to see it after the first time? Any advice?
Long story short. I have a basic script taken from player and put into a zombie npc. I added a animation called hand slap and in that animation there is an "End" event, as well as a "DealDamage" event.
Whats confusing is the zombie is running the animation and dealing the damage constantly but it is dealing more than 1 damage on one swing (running the GetMarkerReachedSignal method too many times, and any animations after the first aren't seen by the client.
Any ideas?
Note: BoolIfAttacked is just used to see if the zombie is attacking
Double Note: We are going for a combat system similar to runescape
GIF OF WHAT IS HAPPENING HERE - https://gyazo.com/1fd951ff83533f6566ca8a76e2c575a2
function onRunning(speed)
if script.parent.BoolIfAttacking.Disabled ~= true then
if speed > 0.01 then
local scale = 15.0
playAnimation("walk", 0.1, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
else
pose = "Standing"
playAnimation("handslap", 0.1, Humanoid)
currentAnimTrack.Looped = true;
currentAnimTrack:GetMarkerReachedSignal("DealDamage"):Connect(function()
local target = script.Parent.Script.Value.Value
local attacking = false
if (target ~= nil) and attacking == false then
attacking = true
target.Humanoid.Health = target.Humanoid.Health - 1
wait(1)
attacking = false
end
end)
end
end
