I’m making a group rank only access to click certain things and it keeps popping up this error and i’ve tried to fix the errors but i just don’t know what to do here’s the error
[Workspace.LightSwitch.OnOff:21: ‘end’ expected (to close ‘if’ at line 7) near ‘’
Here’s my script that i’m having issues with.
local GetRankInGroup = 2929968
local rank = 255
local state = false
function onMouseClick(player)
if not player then return end
if player:GetRankInGroup(group) >= rank then
ClickDetector.mouseClick:connect(function(touched)
state = not state
if state then
script.Parent.Light.PointLight.Enabled = true
script.Parent.On.Transparency = 0
script.Parent.Off.Transparency = 1
else
script.Parent.Light.PointLight.Enabled = false
script.Parent.On.Transparency = 1
script.Parent.Off.Transparency = 0
end
end)
any thing i can do to fix it?