What do you want to achieve? Keep it simple and clear!
I have an equipped animation when tool is equipped. I want to stop tool’s handout animation
What is the issue? Include screenshots / videos if possible!
sometimes, the tool’s handout animation plays before my custom equipped animation
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried putting code in local and server scripts, but none helped me completely override the tool’s handout animation. I also tried to use ChildAdded instead of Equipped. I tried setting toolnone. I have looked at old post, but they dont really help much.
local player = game.Players.LocalPlayer
local tool = script.Parent -- Assuming this script is a child of the tool
local character = player.Character
if not character then
return
end
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid then
return
end
local swordAnimation = Instance.new("Animation")
swordAnimation.AnimationId = "rbxassetid://15505895830"
local newAnimator = humanoid:FindFirstChildOfClass("Animator")
local swordAnimationTrack = newAnimator:LoadAnimation(swordAnimation)
swordAnimationTrack.Priority = 2
-- Reference to the RemoteEvent
local equipToolEvent = game.ReplicatedStorage.EquipToolEvent
-- Function to handle tool equipped event
local function onEquipped()
swordAnimationTrack:Play()
end
local function onUnequipped()
swordAnimationTrack:Stop()
end
-- Connect the function to the equipped event
tool.Equipped:Connect(onEquipped)
tool.Unequipped:Connect(onUnequipped)
You can achieve it with a verybutchered method, but a method that’ll work nonetheless. Follow the steps in the DevForum post I linked and tell me if that works.
I have seen this one and it works for me, but I am not sure if it introduces any bugs later tho@@ since it is engine code. this is what I’ve done incase anyone wanna do this one. I think ill stick with this since using tool with custom handle is more troublesome.