I am trying to make a script that only activates if a player who is the owner of a group clicks the ClickDetector, but it just doesn’t work. I get no errors, and it’s not an issue with the main part of the script, it just won’t carry out the script.
Here it is
local GroupId = 6012187
function onClicked(player)
if player.Parent and player.Parent:FindFirstChild("Humanoid") and game.Players:GetPlayerFromCharacter(player.Parent) then
local Player = game.Players:GetPlayerFromCharacter(player.Parent)
if Player:GetRankInGroup(GroupId) == 255 then
--what I refer to as the 'main part of the script'
workspace.Bright.Color = Color3.fromRGB(255, 0, 0)
end
end
end
script.Parent.Parent.ClickDetector.MouseClick:connect(onClicked)
Thank you in advance.
