Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make this keybind effect toggle?

Asked by 3 years ago

I've scripted these goggles that change the tint of your screen. Issue is, every time I press the key, with or without the tool equipped. How can I fix this?

Code:

local UserInputService = game:GetService("UserInputService")

local function GetInput(input, gpe)
    if input.KeyCode == Enum.KeyCode.T then
        local thermal = Instance.new("ColorCorrectionEffect", game.Lighting)
        thermal.Brightness = 0.3
        thermal.Saturation = 1
        thermal.TintColor = Color3.fromRGB(255,0,0)

    end
end

UserInputService.InputBegan:Connect(GetInput)

1 answer

Log in to vote
0
Answered by 3 years ago

Nevermind, I fixed it by just making it so it would be on equip instead of keybind.

Ad

Answer this question