Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why is this animaiton not playing when I start the script?

Script below is localscript.

-- Variables --
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteStorage = ReplicatedStorage:WaitForChild("RemoteEvents")
local Remote = RemoteStorage:WaitForChild("ForwardDashEvent")

local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()

local userinput = game:GetService("UserInputService")

-- Settings --
local Debounce = true
local pressed = time()
local waitTime= .25

local Animation = Instance.new("Animation")
Animation.AnimationId = 'rbxassetid:2589911948'

userinput.InputBegan:connect(function(Input, IsTyping)
	if IsTyping then return end
	if Input.KeyCode == Enum.KeyCode.W and Debounce then
       if time() - pressed < waitTime and Debounce then
	Debounce = false
		local LoadAnimation = Char.Humanoid:LoadAnimation(Animation)
		LoadAnimation:Play()
		Remote:FireServer("Dash")
		wait(1)
		Debounce = true
        else
		end
        pressed = tick()
	end
end)

The Output is keep saying Animation "rbxassetid:2589911948" failed to load in "Animation.AnimationId": Animation failed to load two times every time I start the script. Can you give me the solution?

2 comments

0

That is because you do not own the animation. The animation needs to be yours.

0

rbxassetid://2589911948 ... you have the wrong assetID

1 answer

✓ Accepted answer

So, there are two things this could be. It's either that you don't own the animation, or you got the ID wrong. Most likely it's that you don't own the animation. If you can, try importing the animation in animation editor, and export it as your own, then use the new one instead of the old one. I don't understand why Roblox does it like this, but it just does. For some reason Roblox just makes it show up an error unless the owner of the animation makes the script, even if the animation is in a group, it still does this.

This discussion is preserved as it was. New answers, comments, and votes are closed.