I got this script where it has a toggle variable. You click once the variable becomes true, you click again it becomes false and repeat. However, if you hold the key it becomes true but when you stop holding it, it becomes false. I am trying to find a way for that not to happen.
The script:
local function testFunction()
if test == false then
test = true
print(test)
elseif test == true then
test = false
print(test)
end
end
CAS:BindAction("name",testFunction,true,Enum.KeyCode.F)
CAS:SetTitle("name","test")
CAS:SetPosition("name",UDim2.fromScale(0.54,0.786))