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
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
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:
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
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)