squidingtin

Flash Light ProtoSmasher

Dec 8th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LightBrightness = 35 --Lights Brightness
  2. LightRange = 30 --Lights Range
  3. LKeyBind = "e" --Light on/off
  4. SKeyBind = "q" --Shadows on/off
  5.  
  6.  
  7. local mouse = game.Players.LocalPlayer:GetMouse()
  8. function Shadows()
  9. player = game.Players.LocalPlayer
  10. Char = player.Character
  11. Root = Char.HumanoidRootPart
  12. RootLight = Root:FindFirstChild("Light")
  13. if RootLight.Shadows == false then
  14. Root.Transparency = 0.5
  15. RootLight.Shadows = true
  16. elseif RootLight.Shadows == true then
  17. Root.Transparency = 1
  18. RootLight.Shadows = false
  19. end
  20. end
  21.  
  22. function Light()
  23. player = game.Players.LocalPlayer
  24. Char = player.Character
  25. playerLight = Char.HumanoidRootPart:FindFirstChild("Light")
  26. playerHead = Char.Head
  27. if playerLight then
  28. if playerLight.Enabled == true then
  29. playerLight.Enabled = false
  30. elseif playerLight.Enabled == false then
  31. playerLight.Enabled = true
  32. playerLight.Color = playerHead.Color
  33. end
  34. else
  35. light = Instance.new("SurfaceLight",Char:FindFirstChild("HumanoidRootPart"))
  36. light.Name = "Light"
  37. light.Color = playerHead.Color
  38. light.Range = LightRange
  39. light.Brightness = LightBrightness
  40. light.Shadows = false
  41. end
  42. end
  43.  
  44. mouse.KeyDown:connect(function(key)
  45. key = key:lower()
  46. if key == LKeyBind then
  47. Light()
  48. end
  49. if key == SKeyBind then
  50. Shadows()
  51. end
  52. end)
Add Comment
Please, Sign In to add comment