RunService.Stepped connection wont disconnect

Look at the bottom and you can see I clearly disconnect it, yet it still keeps going:

pcall(function()
						airConnection = game:GetService("RunService").Stepped:Connect(function()
						
						if not char or not v or hum.Health == 0 or v.Parent.Humanoid.Health == 0 then airConnection:Disconnect()
							char:SetAttribute("InAir", false)
							print("changed from stupid air connection")
							if char.HumanoidRootPart:FindFirstChild("AlignPosition") then
								char.HumanoidRootPart:FindFirstChild("AlignPosition"):Destroy()
							end
						end
						if tick() - lastAirAttack >= 1 then
							if v.Parent.HumanoidRootPart:FindFirstChild("AlignPosition") and char:GetAttribute("HyperArmor") then
								v.Parent.HumanoidRootPart:FindFirstChild("AlignPosition"):Destroy()
							end
							if char.HumanoidRootPart:FindFirstChild("AlignPosition") and char:GetAttribute("HyperArmor") then
								print("deletedFromAirAttack")
								char.HumanoidRootPart:FindFirstChild("AlignPosition"):Destroy()
							end
							airConnection:Disconnect()
							char:SetAttribute("InAir", false)
							v.Parent:SetAttribute("InAir", false)
							print("Changed from air attack connection STIILL")
						end
						end)
						end)

Using :Disconnect() won’t halt the event from continuing to run further, if that is what you meant.
Instead, it would essentially stop watching the event, meaning it won’t run anymore after.

Instead, you could use “return” to stop further execution after you have disconnected the event if that is what you are after. Make sure you disconnect before you use return.

airConnection:Disconnect()
return

I just tried this yet it keeps printing “Changed from air attack connection STIILL”

Could you show me the updated code?

pcall(function()
						airConnection = game:GetService("RunService").Stepped:Connect(function()
						
						if not char or not v or hum.Health == 0 or v.Parent.Humanoid.Health == 0 then airConnection:Disconnect()
							char:SetAttribute("InAir", false)
							print("changed from stupid air connection")
							if char.HumanoidRootPart:FindFirstChild("AlignPosition") then
								char.HumanoidRootPart:FindFirstChild("AlignPosition"):Destroy()
							end
						end
						if tick() - lastAirAttack >= 1 then
							if v.Parent.HumanoidRootPart:FindFirstChild("AlignPosition") and char:GetAttribute("HyperArmor") then
								v.Parent.HumanoidRootPart:FindFirstChild("AlignPosition"):Destroy()
							end
							if char.HumanoidRootPart:FindFirstChild("AlignPosition") and char:GetAttribute("HyperArmor") then
								print("deletedFromAirAttack")
								char.HumanoidRootPart:FindFirstChild("AlignPosition"):Destroy()
							end
							char:SetAttribute("InAir", false)
							v.Parent:SetAttribute("InAir", false)
							print("Changed from air attack connection STIILL")
							airConnection:Disconnect()
							return
						end
						end)
						end)

What is the intended behaviour here? Where in the code do you expect further execution to stop? What I mean by this is how are you testing it, because I see two disconnect calls within the connection itself, so I was wondering what conditions you are creating during testing.

Well I made it so that it will fire a different event to this when InAir is true, but this keeps making InAir false since i for some reason cant disconnect it

Can you please confirm that print("Changed from air attack connection STIILL") outputs?

yes it does [char minnnnnnnnn]

this might be wrong but from what i could see you’re disconnecting the function from inside itself? that may cause a problem but i doubt it

No that’s not the issue [char min]

Have you tried using RunService:BindToRenderStep?

try

RunService:BindToRenderStep("airConnection", 1000, typefunctionhere)

and then

RunService:UnbindFromRenderStep("airConnection")

Can you please try removing the pcall? It’s possible that the code is erroring at some point, and the pcall is just silencing it.