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
Animations will only work in studio for the person who created the animation, period, there is no work around unless you are using animations created by ROBLOX.
While this may be inconvenient for team creations, this is to prevent players from stealing the item.
The animations will play for all players when in-game if the group owner or place owner (depending on what type of game this is) owns the animation.
If you want to test the animation yourself, you will have to upload it to ROBLOX using the animation editor.
This is not a script error (though im not 100% sure). You might have to go into animation editor and publish the animation as your own. Then use that id in your script