A group only click detector

Hi, I would like some help with a group only click detector, script is below, if someone could it for me it would be much appriciated.

https://gyazo.com/af5463c9b67f7f236c72b29e6339b2b6

https://gyazo.com/a833b7e2e8da72d9b972f0b4051d6f33

https://gyazo.com/c9344183fb8d53628e5c7a7a56e8b554

1 Like

https://developer.roblox.com/en-us/api-reference/function/Player/IsInGroup

This is for scripting support, it’s not a place to ask other people to code for you. On top of that what have you done currently to try to tackle the problem you are facing? Have you read on the wiki or searched on the forum for similar posts? Also i’d recommend using codeblocks rather than posting screenshots.

Do codeblocks like this:

image

For what you are looking at you want to use the :IsInGroup() method of a player object. The player object is passed directly into the clickdetectors event parameters.

if Player:IsInGroup(GroupID) then
-- Do something
else
-- Do something else
end
1 Like

A few seconds of searching would give you the answer. Please do so first before posting topics and make sure to read our category guidelines.

A ClickDetector will pass the Player object of the client who interacted with it. You can check if a player is in a group via IsInGroup. Put these together then and you have your group only clicker.

ClickDetector.MouseClick:Connect(function (player)
    if player:IsInGroup(0) then
        -- Do action
    end
end)
1 Like