So recently me and my friend (beginner scripters) Made a lighting script
script.Parent.ClickDetector.MouseClick:connect(function()
if game.Workspace.Light.Light.PointLight.Enabled == false
then
game.Workspace.Light.Light.PointLight.Enabled = true
game.Workspace.Light.Light.Material = "Neon"
game.Workspace.lsw1.Union.Transparency = 1
game.Workspace.lsw1.ls2.Transparency = 0
else
game.Workspace.Light.Light.PointLight.Enabled = false
game.Workspace.Light.Light.Material = "Plastic"
game.Workspace.lsw1.Union.Transparency = 0
game.Workspace.lsw1.ls2.Transparency = 1
end
end)
The script works, however it only work witha single part with a pointlight, not entirerly sure how to fix that. My second question is would it be possible fo the switch to work if only a specific ranked player from group can press it. AgaIn not very sure to script these myself since I am very new, but I appreciate any help given thank you!

1 comment
https://www.robloxdev.com/api-reference/function/Player/GetRoleInGroup