i have been trying to make this blocking system but anim:stop wont work
function bLOCK ()
local anim = Player.Character.Humanoid:LoadAnimation(script.Block)
if uis2:IsKeyDown(Enum.KeyCode.F) then
if db == true then return end
if blocking == false then
blocking = true
db =true
block:FireServer(click,uis2)
anim:Play()
Player.Character.Humanoid.JumpPower = 0
wait(0.4)
db =false
end
elseif not uis2:IsKeyDown(Enum.KeyCode.F) then
if blocking == true then
blocking = false
anim:Stop()
end
end
end
try using :print() to debug that. maybe its not actually going to the part asking for it to stop?
blocking might not actually be true, idk how but im attempting.
Try moving the animation variable outside the function:
local anim = Player.Character.Humanoid:LoadAnimation(script.Block)
function bLOCK ()
if uis2:IsKeyDown(Enum.KeyCode.F) then
if db == true then return end
if blocking == false then
blocking = true
db =true
block:FireServer(click,uis2)
anim:Play()
Player.Character.Humanoid.JumpPower = 0
wait(0.4)
db =false
end
elseif not uis2:IsKeyDown(Enum.KeyCode.F) then
if blocking == true then
blocking = false
anim:Stop()
end
end
end