What do you want to achieve?
To stop the custom walking animation from running when I start walking, when the toggle is off
What is the issue?
Custom walking animation keeps running when I walk, despite my toggle being off
What solutions have you tried so far?
I looked in the forum for answers, ChatGPT and Assistant too, but couldn’t get it to work.
The only thing preventing me from achieving the code is the runConnection:Disconnect function not working
Callback = function(Value)
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local SCP001RunAnim = humanoid:WaitForChild("SCP001Run")
local SCP001RunTrack = animator:LoadAnimation(SCP001RunAnim)
-- Store the connection in a variable
local runConnection
local function moveRun(speed)
if speed == 0 then
SCP001RunTrack:Stop()
else
SCP001RunTrack:Play()
end
end
if Value == true then
runConnection = humanoid.Running:Connect(moveRun)
else
SCP001RunTrack:Stop()
if runConnection then
runConnection:Disconnect()
runConnection = nil
end
end
end
})