Hello, I’m currently working on a boolean script, and I’ve ran into a problem. When the boolean is set the true, although everything is working as intended. The player doesn’t start off in the animation when standing still. All the major problems accrue when the boolean is set to false. If I do set the boolean to false and the animation was previously playing then yeah, It’ll stop the animation. But if I start walking and stand still the animation plays even though the boolean is false. Why is this happening?
Code:
function QBMode(Boolean)
if Boolean == true then
Character.CharacterInformation.InQBMode.Value = true
LockModule:Mode(true)
Humanoid.Running:Connect(function(Speed)
if Speed == 0 and not InQB then
InQB = true
local Moved = false
-- Anims --
if not Moved then
QBAnimation:Play()
end
Humanoid.Running:Wait()
Moved = true
QBAnimation:Stop()
InQB = false
end
end)
elseif Boolean == false then
Character.CharacterInformation.InQBMode.Value = false
InQB = false
LockModule:Mode(false)
QBAnimation:Stop()
end
end
--