How do I make it so a group rank+ can click something to make it dissapear and click again to re-appear?

Hey!
Im making a theme park and need a chain so cirtain ranks can click a chain and it will make it invisible and able to walk through, then after you click it again it goes back to visible and not able to walk through!

RobloxScreenShot20230103_112554974

I have tried adding a click script and a roup rank script linked up, but it doesent work.

Please can someone help?
If so, could you write the script?

Thanks!

Maybe try:

local chain = script.Parent -- Change this to where the chain is
local debounce = false

script.Parent.ClickDetector.MouseClick:Connect(function(plr) -- Make sure you've added a clickdetector
if plr:IsInGroup(Paste Group ID Here) and plr:GetRankInGroup(Paste Group ID Here) > 5--[[the rank in the group]] then
if debounce == false then
debounce = true
chain.CanCollide = false
chain.Transparency = 1
elseif debounce == true then
debounce = false
chain.CanCollide = true
chain.Transparency = 0 -- Or what you set the transparency as beforehand
end
end
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.