George148

Nightvision

May 25th, 2015
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2.  
  3. local Brightness = 1000
  4. local Color = Color3.new(0/255,255/255,0/255)
  5. local Range = 30
  6.  
  7. local On = false
  8.  
  9. local First_Person_When_On = true
  10. local Original_Camera_Setting = Enum.CameraMode.Classic
  11.  
  12. Player:GetMouse().KeyDown:connect(function(Key)
  13. if (Key:lower() == "e") then
  14. if (On == false) then
  15. On = true
  16. if (First_Person_When_On == true) then
  17. Original_Camera_Setting = Player.CameraMode
  18. Player.CameraMode = Enum.CameraMode.LockFirstPerson
  19. local gui = Instance.new("ScreenGui")
  20. gui.Name = "Gui"
  21. local frame = Instance.new("ImageLabel")
  22. gui.Parent = Player.PlayerGui
  23. frame.Parent = gui
  24. gui.Parent = Player.PlayerGui
  25. frame.Size = UDim2.new(0,5000,0,5000)
  26. frame.BackgroundColor3 = Color3.new(0,170,0)
  27. frame.BackgroundTransparency = .8
  28. end
  29.  
  30. local Part = Instance.new("Part", game.Workspace.CurrentCamera)
  31. Part.Name = "NightVision"
  32. Part.CanCollide = false
  33. Part.Transparency = 1
  34. local Light = Instance.new("PointLight", Part)
  35. Light.Brightness = Brightness
  36. Light.Color = Color
  37. Light.Range = Range
  38. local Weld = Instance.new("Weld", Part)
  39. Weld.Part0 = Part
  40. Weld.Part1 = Player.Character.Head
  41. else
  42. On = false
  43. Player.CameraMode = Original_Camera_Setting
  44. local Search = game.Workspace.CurrentCamera:FindFirstChild("NightVision")
  45. local Check = Player.PlayerGui:FindFirstChild("Gui")
  46. if Player.Character.Humanoid.Health == 0 then
  47. Search:Destroy()
  48. Check:Destroy()
  49. end
  50. if (Search) then
  51. Search:Destroy()
  52. if (Check) then
  53. Check:Destroy()
  54. end
  55. end
  56. end
  57. end
  58. end)
  59. while wait() do
  60. if Player.Character.Humanoid.Health == 0 then
  61. Player.CameraMode = Original_Camera_Setting
  62. SearchGui = game.Players.LocalPlayer.PlayerGui:FindFirstChild("Gui", true)
  63. SearchNV = game.Workspace.CurrentCamera:FindFirstChild("NightVision")
  64. if SearchGui and SearchNV then
  65. SearchGui:Destroy()
  66. SearchNV:Destroy()
  67. end
  68. end
  69. end
  70. local GuideGui = Instance.new("ScreenGui", Player:WaitForChild("PlayerGui"))
  71. local Box = Instance.new("TextLabel", GuideGui)
  72. Box.Size = UDim2.new(1,0,1,0)
  73. Box.BackgroundTransparency = 1
  74. Box.FontSize = "Size48"
  75. Box.TextColor3 = Color
  76. Box.Text = "Press 'e' to enable night vision"
  77. wait(1)
  78. for i = 0, 1, 0.1 do
  79. Box.TextTransparency = i
  80. wait(0.1)
  81. end
  82. GuideGui:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment