Hi <3 I haven’t skill in scripting but , i used AI for create script. It isn’t work.
Pls fix this code or send tutorial.
I put it in
Script :
local animationId = “13660732928”
local function playAnimation()
local humanoid = script.Parent:FindFirstChildOfClass(“Humanoid”)
if humanoid then
humanoid:LoadAnimation(Instance.new(“Animation”, humanoid)).AnimationId = animationId
end
end
local animationId = “13660673130”
local player = game.Players.LocalPlayer local mouse = player:GetMouse()
local function playAnimation()
local humanoid = player.Character and player.Character:FindFirstChildOfClass(“Humanoid”)
if humanoid then
humanoid:LoadAnimation(Instance.new(“Animation”, humanoid)).AnimationId = animationId
end
end
local animationId = “13660673130”
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local function playAnimation()
local humanoid = player.Character and player.Character:FindFirstChildOfClass(“Humanoid”)
if humanoid then
local track = humanoid:LoadAnimation(Instance.new(“Animation”, humanoid))
track.AnimationId = animationId
track:Play()
end
end
mouse.Button1Down:Connect(playAnimation)
--[[
This script will play an animation when mousebutton1 is clicked.
]]
--[[ SERVICES ]]
local Players = game:GetService("Players")
--[[ CONSTANTS ]]
local ANIMATION_ID = "rbxassetid://13660732928" --put your animation here
--[[ VARIABLES ]]
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local mouse = player:GetMouse()
local animation = Instance.new("Animation")
animation.AnimationId = ANIMATION_ID
local animationTrack = animator:LoadAnimation(animation)
--[[ CODE ]]
mouse.Button1Down:Connect(function()
animationTrack:Play()
end)