Whenever I play the game and press E it says in the output, "Animation "https://www.roblox.com//asset/?id=2920259551&serverplaceid=0" failed to load in "Animation.AnimationId": Animation failed to load" And when the person who made the animation does it it work.
Script:
local debounce = false
game.ReplicatedStorage:WaitForChild("Punch"):FireServer()
function PunchAnimation(input)
if input.KeyCode == Enum.KeyCode.E and debounce == false then
debounce = true
local anim = Instance.new('Animation')
local player = game.Players.LocalPlayer
anim.AnimationId = 'rbxassetid://2920259551'
local loadanimation = player.Character.Humanoid:LoadAnimation(anim)
loadanimation:Play()
game.Players.LocalPlayer.Character:FindFirstChild("RightHand").Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil and debounce == false then
debounce = true
local char = hit.Parent:FindFirstChild("Humanoid")
char:TakeDamage(20)
wait(5)
debounce = false
end
end)
wait(5)
debounce = false
end
end
game:GetService("UserInputService").InputBegan:Connect(PunchAnimation)
[SerpentineKing]: Input correct code format

2 comments
normal script or local script?
Try trying the game with the actual roblox player not studio. Roblox is having a lot of errors with decals, animations and audio!