require(game.ReplicatedStorage.ControlBinds).Crouch(game.Players.LocalPlayer,iscrouching) if iscrouching==false then iscrouching=true elseif iscrouching==true then iscrouching=false end end
I can't figure out how to make it fire once. I understand what is wrong, it fires and then it sets iscrouching to true which makes the other one fire.
At the end of the function, it always sets iscrouching to false, because iscrouching is set to true once the player crouches, which causes the code that sets it to false to run.
Instead of
if iscrouching==false then iscrouching=true elseif iscrouching==true then iscrouching=false end
use
iscrouching = not iscrouching