What do you want to achieve?
When I unequip a tool, you should not be able to trigger animations specific to that tool anymore.
What is the issue?
The player can still trigger animations that should only play when you are holding the tool.
What solutions have you tried so far?
I have tried making it so that the player can only trigger animations when the weapon is parented to their character. For some reason that didn’t seem to work, so I think I did something wrong.
--Local script inside of tool. This part of the script sets the gun to the "lowered" position shown in the video.
script.Parent.Equipped:Connect(function()
local M16 = player.Character:FindFirstChild("M16A3")
if M16 then
game:GetService("UserInputService").InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.Q then
idleAnimTrack:Play()
aimAnimTrack:Stop()
idleAnimTrack.Looped = true
end
end)
end
end)
Sorry if I screwed up on anything obvious, I’m still very new at scripting.
There is already something like that in the script. It stops animations that are currently playing, but doesn’t stop them from being played again. Is this how I’m supposed to be doing things or am I far off?