Not allowing player to unequip during equipping animation

Hello, in my game when a player equips a tool they spawn with in their inventory it plays an equipping animation. This happens with a Equipped tool event, and I’m also using a event that fires when the equipping animation ends so the player can stay in a holding animation.

Is there any way I can disable the player’s ability to unequip the tool?

What I mean is I want the school to stay equipped even when the player is trying to press the tool again to unequip it, until they’re allowed to unequip it again (In my case after the equipping animation ends)

I tried using “StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false),” but I don’t want the gui to just disappear while the player’s equipping, I would rather it stay visible. Any help will be appreciated, thank you for your time!

Just use a debounce that waits until the AnimationTrack.Ended Event fires. Once the track is done then it’ll allow the unequip input to fire.

1 Like

Apologies for the late reply, I’m having trouble with the use of a debounce, do you mean yield the thread until the event fires?

repeat task.wait() until (your AnimationTrack).Ended will pause the code until the animation ends.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.