local Attackhitboxes = require(script.Parent.AttackHitboxes)
local ClickAttackDebounces = {}
Events.ClickAttack.OnServerEvent:Connect(function(Player) local Character = Player.Character if Character == nil then return end local Humanoid = Character:FindFirstChild("Humanoid") if Humanoid == nil then return end if Humanoid.Health <= 0 then return end if ClickAttackDebounces[Player] then return end
ClickAttackDebounces[Player] = true local PunchCombo = Player.Values.PunchCombo local Animation = script.PunchAnimationsCycle[tostring(PunchCombo.Value)] local LoadedPunchAnimation = Humanoid.Animator:LoadAnimation(Animation) LoadedPunchAnimation.Play()
if PunchCombo.Value >= #script.PunchAnimationsCycle:GetChildren() then PunchCombo.Value = 1 else PunchCombo.Value += 1 end
task.wait(LoadedPunchAnimation.Length + 0.1) if ClickAttackDebounces[Player] then ClickAttackDebounces[Player] = nil end end)
вот скрипт но пишет в оутпуте LoadAnimation requires the asset id to not be empty что делать помогите пожалуйста (анимация не возпроизводится)
local Players = game:GetService("Players")
local Events = ReplicatedStorage.Events
local Attackhitboxes = require(script.Parent.AttackHitboxes)
local ClickAttackDebounces = {}
Events.ClickAttack.OnServerEvent:Connect(function(Player)
local Character = Player.Character
if Character == nil then
return
end
local Humanoid = Character:FindFirstChild("Humanoid")
if Humanoid == nil then
return
end
if Humanoid.Health <= 0 then
return
end
if ClickAttackDebounces[Player] then
return
end
ClickAttackDebounces[Player] = true
local PunchCombo = Player.Values.PunchCombo
local Animation = script.PunchAnimationsCycle[tostring(PunchCombo.Value)]
local LoadedPunchAnimation = Humanoid.Animator:LoadAnimation(Animation)
LoadedPunchAnimation.Play()
if PunchCombo.Value >= #script.PunchAnimationsCycle:GetChildren() then
PunchCombo.Value = 1
else
PunchCombo.Value += 1
end
task.wait(LoadedPunchAnimation.Length + 0.1)
if ClickAttackDebounces[Player] then
ClickAttackDebounces[Player] = nil
end
end)
вот скрипт но пишет в оутпуте LoadAnimation requires the asset id to not be empty что делать помогите пожалуйста (анимация не возпроизводится)