Advertisement
Cakey3101

ShadowHandler - LocalScript!

Apr 13th, 2024
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | Source Code | 0 0
  1. local Lighting = game:GetService("Lighting") -- Defining The Lighting Service!
  2.  
  3. local Button = script.Parent.ShadowButton -- Getting The Button From The GUI
  4.  
  5. local On = true -- Setting A Variable To Keep Track Of The State Of The Shadows
  6.  
  7. Button.MouseButton1Click:Connect(function() -- Connecting If It Is Clicked
  8.     if On == false then -- Checking If On Is False / Shadows Is Off
  9.         Lighting.GlobalShadows = true
  10.         Button.Text = "Shadows : ON" -- Setting The Text On The GUI To Show The Shadows Are On
  11.         On = true -- Setting The Variable To True To Keep Track Of The State
  12.     else -- Otherwise
  13.         Lighting.GlobalShadows = false
  14.         Button.Text = "Shadows : OFF" -- Setting The Text On The GUI To Show The Shadows Are Off
  15.         On = false -- Setting The Variable To False To Keep Track Of The State
  16.     end
  17. end) -- Ending The Function
Tags: Roblox lua
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement