This is my script so far (im VERY new to scripting)
function onClicked() script.Parent.Parent.Gate.Transparency = 1 script.Parent.Parent.Gate.CanCollide = false wait(.001) end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
I am completly lost on how to make it so let say my group and rank 123 can click this button for it to function
Use the Player:IsInGroup() function like so:
local groupId = 123 -- change to your group id local gate = script.Parent.Parent.Gate script.Parent.ClickDetector.MouseClick:Connect(function(plr) if plr:IsInGroup(groupId) then gate.Transparency = 1 gate.CanCollide = false end end)
If you want only specific ranks to be able to click it, use Player:GetRankInGroup() and do something like this:
local groupId = 123 -- change to your group id local minRank = 100 local gate = script.Parent.Parent.Gate script.Parent.ClickDetector.MouseClick:Connect(function(plr) if plr:GetRankInGroup(groupId) >= minRank then --if its equal or greater than gate.Transparency = 1 gate.CanCollide = false end end)