What’s wrong with my script? I need to reproduce an animation that I buy in the catalog, it is exactly this: (29) Celebrando - Roblox
how could i fix that? please someone help me
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://3994127840" -- Celebrate Celebrando plays
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)
Well, don’t use Animator.
You can just use humanoid:LoadAnimation()
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://3994127840" -- Celebrate Celebrando plays
local danc = humanoid:LoadAnimation(dance)
danc:Play() -- play the animation
end)