Players.octav20071.Backpack.Punch:59: attempt to index nil with ‘Ended’
On this lines of code:
if TargetHumanoid:FindFirstChild("Monster") then
PunchEvent:FireServer(TargetHumanoid,_Damage.Value)
local Anim = Humanoid.Animator:LoadAnimation(ChosenAnim)
Anim:Play()
PunchSound:Play()
TheGame:AnchorCharacter(Player)
Anim.Ended:Wait() -- error
TheGame:UnanchorCharacter(Player)
if TargetHumanoid:FindFirstChild("Monster") then
PunchEvent:FireServer(TargetHumanoid,_Damage.Value)
local Anim = Humanoid.Animator:LoadAnimation(ChosenAnim)
Anim:Play()
PunchSound:Play()
TheGame:AnchorCharacter(Player)
Anim.Stopped:Wait()
TheGame:UnanchorCharacter(Player)
-- while ChosenAnim is
local ChosenAnim = PunchAnims[math.random(1, #PunchAnims)]