-- 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()
@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)
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)