Here's my script:
local Mouse = game.Players.LocalPlayer:GetMouse() local anime = script.Animation Mouse.Button1Down:Connect(function() print("IT WORKED") anime:Play() end)
It worked until I added the animation:Play()
You gotta load the animation in the humanoid.
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local anime = humanoid:LoadAnimation(script.Animation) anime:Play()
use :LoadAnimation([Animation]) and put script to StarterCharacterScripts
local Mouse = game.Players.LocalPlayer:GetMouse() local anime = script.Animation Mouse.Button1Down:Connect(function() script.Parent.Humanoid:LoadAnimation(anime):Play() end)