How could i play a animation from catalogue?

Hello i want to know what im doing wrong, i want to paly this animation when i press a button

How to play this animation when i press a button?
(29) Baile de “HOLIDAY” - Lil Nas X (LNX) - Roblox

LocalScript:

script.Parent.MouseButton1Click:Connect(function()

script.Parent.RemoteEvent:FireServer()

end)

Server Script:

script.Parent.RemoteEvent.OnServerEvent:Connect(function()
	local dance = Instance.new("Animation")
	dance.AnimationId = "rbxassetid://5938396308"
	
	local animator = Instance.new("Animator")
	local danc = animator:LoadAnimation(dance)
end)

image

You cannot do that unless it’s in your inventory.

but the code is well programmed?

No, you dont use a animator you use a humanoid to loadanimation.

oh you mean something like this? (example code)

-- Declared
local normalPunch = Instance.new("Animation")
local fastPunch = Instance.new("Animation")

local Animator = game:GetService("Players").LocalPlayer.Character:WaitForChild("Humanoid"):WaitForChild("Animator")

normalPunch.AnimationId = "rbxassetid://6266470138" -- Normal punch
fastPunch.AnimationId = "rbxassetid://6266622226" -- Fast punch

local UserInputService = game:GetService("UserInputService")

UserInputService.InputBegan:Connect(function(input, gameProcessed)

	if input.UserInputType == Enum.UserInputType.MouseButton1 then
		-- code
		Animator:LoadAnimation(normalPunch):Play()

Humanoid:LoadAnimation() was deprecated

@PipeSader
You can only play animations from your inventory unless they’re publicly available.
If it’s a catalog animation, you would have to look for the animation id.

The animation id for you’re looking for is 5937558680

script.Parent.RemoteEvent.OnServerEvent:Connect(function(player)
    local character = player.Character or player.CharacterAdded:Wait() -- get the player's character
    local humanoid = charcter:FindFirstChildOfClass("Humanoid") -- get their humanoid

	local dance = Instance.new("Animation")
	dance.AnimationId = "rbxassetid://5937558680"
	
	local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid) -- find the animator or create a new one
	local danc = animator:LoadAnimation(dance)
    danc:Play() -- play the animation
end)
2 Likes

it din’t worked nothing happen when i pressed the button :frowning:

he can play an animation from the catalog if he doesn’t own it. as long as its owned by the roblox account

i am trying with this animation and nothing happen (29) Aplauso - Roblox

i have this animation already bought

I made a minor typo, this should work

script.Parent.RemoteEvent.OnServerEvent:Connect(function(player)
    local character = player.Character or player.CharacterAdded:Wait() -- get the player's character
    local humanoid = character:FindFirstChildOfClass("Humanoid") -- get their humanoid

	local dance = Instance.new("Animation")
	dance.AnimationId = "rbxassetid://5937558680"
	
	local animator = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid) -- find the animator or create a new one
	local danc = animator:LoadAnimation(dance)
    danc:Play() -- play the animation
end)
2 Likes

you need the actual id of it
which is 5915693819
https://www.roblox.com/library/5915693819/EmoteClap

note: u dont need to buy/own it

1 Like

This might be affecting it but are you developing this game in a group, because if you are the group needs to own the animation.

You must own animation. You can download animation with BTRoblox. Here lemme show how;

Now go to chrome webstore and type BTRoblox (Not sponsored lol)

Find your animation

Then press Save button.

Go to studio and make a dummy
‘No ss sorry’

Then make a Model and name it AnimSaves
Finally open the Animation editor and Export it!

1 Like

Not sure if downloading and using offsale animations for yourself is allowed…