Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Animation run on tool Mouse.Button1Down?

local Tool = script.Parent
local Player = game.Players.LocalPlayer
local animation = script.Parent.Animation
 
Tool.Equipped:connect(function(Mouse)
	Mouse.Button1Down:connect(function()
		local animTrack = Player.Humanoid:LoadAnimation(animation)
		animTrack:Play()
	end)
end)

Not sure of the issue.

1 answer

local Tool = script.Parent
local Player = game.Players.LocalPlayer
local animation = script.Parent.Animation

Tool.Activated:connect(function()
	local animTrack = Player.Humanoid:LoadAnimation(animation)
	animTrack:Play()
end)

Tool.Activated is a better way than the one you did, and should resolve the issue! :)

This discussion is preserved as it was. New answers, comments, and votes are closed.