Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make this keybind effect toggle?

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.