You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I would like to enable a GUI using a local script, inside of StarterCharacterScripts. -
What is the issue? Include screenshots / videos if possible!
The issue is that when I do game.ScreenGui.NightVisionGUI.Enabled = true from my local script and play the game, the GUI doesn’t actually enable.
My local script named NightVisionDetectScript inside of StarterCharacterScripts
local uis = game:GetService("UserInputService")
local debounce = false
local isActivated = false
uis.InputBegan:Connect(function(input, gameProccessingEvent)
if gameProccessingEvent then return end
if input.KeyCode == Enum.KeyCode.N and debounce == false and isActivated == false then
debounce = true
isActivated = true
game.Lighting.OutdoorAmbient = Color3.fromRGB(255, 255, 255)
game.Lighting.Atmosphere.Density = 0
game.Lighting.GlobalShadows = false
game.Lighting.ColorCorrection.Enabled = false
game.Lighting.SunRays.Enabled = false
game.Lighting.SunRaysNVG.Enabled = true
game.Lighting.ColorCorrectionNVG.Enabled = true
for i = 1, 70 do
wait(0.005)
game.Lighting.ColorCorrectionNVG.Brightness = game.Lighting.ColorCorrectionNVG.Brightness - 0.01
end
wait(3)
debounce = false
elseif input.KeyCode == Enum.KeyCode.N and debounce == false and isActivated == true then
debounce = true
game.Lighting.OutdoorAmbient = Color3.fromRGB(141, 141, 141)
game.Lighting.Atmosphere.Density = 0.348
game.Lighting.GlobalShadows = true
game.Lighting.ColorCorrectionNVG.Enabled = false
game.Lighting.SunRaysNVG.Enabled = false
game.Lighting.SunRays.Enabled = true
game.Lighting.ColorCorrection.Enabled = true
game.StarterGui.NightVisionGUI.Enabled = false
game.Lighting.ColorCorrectionNVG.Brightness = 1
wait(3)
debounce = false
isActivated = false
end
end)