How do i make my sword do my sword animation when i click while holding the sword, or any other sword?
COMMUNITY QUESTION
How do i make an aimation for a model like a sword play when someone clicks while holding the sword?
2 answers
use this model as you can move the script and animation to any other tool and shouldn't cause any issues (model made by me) https://web.roblox.com/library/6707600197/animation-tool-template
from my understanding you want to play an animation when he click while equipping a tool so firstly insert a local script inside any tool you want and then write this script:
local tool = script.Parent -- the tool
local player = game.Players.LocalPlayer -- the player
local newAnim = Instance.new("Animation",script) -- we insert an animation inside the script
newAnim.AnimationId = "rbxassetid://animationID" -- change animationID to your animationID
local char = player.Character or player.CharacterAdded:Wait() -- the character of the player
local debounce = true -- debounce
tool.Activated:Connect(function() -- activated event fires when the player clicks while equipping the tool
if debounce == true then -- checks if debounce is true
debounce = false -- we set it to false so the animation doesnt keep on re-playing
local animtrack = char.Humanoid:LoadAnimation(newAnim) -- the animation track to play
animtrack:Play() -- playing it
debounce = true -- after the animation finishes we set debounce back to true
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
It did not work
i just made a model that should work