I have this script here, its like a jail gate, but I want it to unlock when clicked I have a click detector and the script inside the jaildoor part. It check the rank of the person from a certain group then open
local jaildoor = script.Parent local ClickDetector = script.Parent.ClickDetector local player = game.Workspace.Players.LocalPlayers

local function open(jaildoo) jaildoo.Transparency = 0.5 jaildoo.CanCollide = true end local function close(jaildoo) jaildoo.Transparency = 0 jaildoo.CanCollide = false end game:GetService("GroupService") jaildoor.ClickDetector.MouseClick:connect(function() end) game.Players.PlayerAdded:Connect(function(Player) if Player:GetRankInGroup(4804428) > 252 then open(jaildoor) wait(10) close(jaildoor) else print("NOPE") end end)

2 comments

0

Filtering enabled? If so, not sure if Click Detector works with this feature turned on.

0

You misspelled "jaildoor" a few times.