Animations
Custom Player Animations
Custom Player Animations
Where to put this script
Where to put this script
In a LocalScript under StarterPlayerScripts
In a LocalScript under StarterPlayerScripts
LocalScript
LocalScript
Update Animation ID with your custom ID
Update Animation ID with your custom ID
local part = game.Workspace.Part
local click = part.ClickDetector
local Players = game:GetService("Players")
local character = Players.LocalPlayer.Character
if not character then
character = Players.LocalPlayer.CharacterAdded:Wait()
end
local humanoid = character:WaitForChild("Humanoid")
local myAnimation = Instance.new("Animation")
myAnimation.AnimationId = "rbxassetid://04822814884"
local myAnimationTrack = humanoid:LoadAnimation(myAnimation)
local function animate()
myAnimationTrack:Play()
end
click.MouseClick:Connect(animate)