Advertisement
DeadGambit

Roblox Tutorial: Night Vision Script

Feb 26th, 2021 (edited)
4,121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. repeat wait() until player.Character
  3.  
  4. local nightVisionEffect = game.Lighting.ColorCorrection
  5.  
  6. local goggles = script.Parent.ImageLabel
  7. local nightVision = false
  8.  
  9. nightVisionEffect.Enabled = false
  10. game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent)
  11.     if gameProcessedEvent == true then return end
  12.    
  13.     if inputObject.KeyCode == Enum.KeyCode.N then
  14.         if nightVision == false then
  15.             nightVision = true
  16.             goggles.Visible = true
  17.             nightVisionEffect.Enabled = true
  18.         elseif nightVision == true then
  19.             nightVision = false
  20.             goggles.Visible = false
  21.             nightVisionEffect.Enabled = false
  22.         end
  23.     end
  24. end)
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement