I want something to happen when I press the Q key and I want something else to happen when I press it again
LOCAL
local TWS = game:GetService("TweenService")
local input = game:GetService("UserInputService")
input.InputBegan:Connect(function(io, key)
if io.KeyCode == Enum.KeyCode.Q then
script.RemoteEvent:FireServer()
script.Disabled = true
end
end)
GLOBAL
local Event = script.Parent
local db = true
local Carpeta = script.Parent.Parent.FX
local User = game:GetService("UserInputService")
local Agarre = Instance.new("Weld")
local Hab = Carpeta:Clone()
Event.OnServerEvent:Connect(function(plr)
local Torso = plr.Character.HumanoidRootPart
Hab.Parent = workspace
local Stand = Hab.Stando
Agarre.Parent = Torso
Agarre.Part0 = Torso
Agarre.Part1 = Stand.HumanoidRootPart
Agarre.C1 = CFrame.new(-3,-1.5,-2)
end)

1 comment
You could set a variable like "local mode = 0" and when you press Q it checks what mode it is on. If it's on 0 then it does function1 and adds 1 to mode. Then when you press Q again, it checks the mode and if it's on 1 then it does function2 and minuses 1.