Hello, I am currently experiencing an issue with my tool that is supposed to enable an animation. It semi works but it is incredibly unreliable. I would like for the player that holds the “Mortar” to crouch down.
Script
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Animation = script:WaitForChild("Animation")
local Track = Humanoid:LoadAnimation(Animation)
Track.Looped = true
Track.Priority = Enum.AnimationPriority.Action
local Handle = script.Parent.Handle
local function onPartTouched(Handle)
Humanoid.WalkSpeed = 1
Track:Play()
end
local function onPartTouchEnded(Handle)
Humanoid.WalkSpeed = 16
Track:Stop()
end
Handle.Touched:Connect(onPartTouched)
Handle.TouchEnded:Connect(onPartTouchEnded)
Nevermind, I converted it for you, just edit your post and copy and paste this link so others wont have to download a video. https://streamable.com/9ggmhd
https:// streamable.com / 9ggmhd (get rid of the spaces and paste it)
Yes. I did not do Tool.Equipped because that is just when the mortar is in the backpack, I only want to activate it when the tool is in the player’s hand.