im trying to make a script when you press G it should turn GlobalShadows Off else turn it On but respawning or walking around for a bit restarts back to it being On
--local script in starterplayerscripts
uis.InputBegan:Connect(function(Input,proc)
if not proc then
if Input.UserInputType == Enum.UserInputType.Keyboard then
if Input.KeyCode == Enum.KeyCode.G then
local shad = game.Lighting.GlobalShadows
shad = false
else
shad = true
end
end
end
end)