whats going on is that when i use my tool and click (to activate my animation) it cancels the walk until you jump/stop moving, any help is appreciated!
video: .bug. - Album on Imgur
(have to use imgur for video)
code:
local mouse = game.Players.LocalPlayer:GetMouse()
local reach = 4
-- other stuff
script.Parent.Activated:Connect(function()
if mouse.Target then
local model = mouse.Target:FindFirstAncestorOfClass("Model")
if model then
if model:FindFirstChild("Humanoid") then
local mag = (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - model.HumanoidRootPart.Position).magnitude
if mag < reach * 3 then
script.Parent.Hit:FireServer(model)
end
end
end
end
end)
local db = false
-- anim
script.Parent.Activated:Connect(function()
if not db then
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local animator = Instance.new("Animator")
animator.Parent = humanoid
local animation = animator:LoadAnimation(script.Parent.Animation)
db = true
animation:Play()
wait(0.2)
db = false
end
end)