Rank Door without transparency/collision

Hiya devforum members, I got a problem.
I want to make a staff door for players who have a minimum rank in the group, but I want a door that does not just change the transparency and the collision. So it would be something with destroying a part just for the client. I hope anyone can help me. Here the script I have used, and how I set it up.
I use basic admin essentials 2.0, maybe that breaks the script or something?

Script
    if plr:GetRankInGroup(5982878) >= 31 then
        if workspace.staffdoor then
            workspace.staffdoor:Destroy()
        end
    end
end)
Screenshot

I have checked other topics but they didn’t work!

Thanks already :smiley:

Hi,

I think you made an error in the naming. You try to delete the ‘SnackDoor’ part, but there isn’t a SnackDoor part, only a staffdoor part :slight_smile:

Hope this fix it, otherwise you can reply!

You can’t use a local script in the ServerScriptService, and if you want it to destroy the door for the client, then add a local script into StarterPlayerScripts and write:

local plr = game.Players.LocalPlayer
local door = workspace:FindFirstChild("staffdoor")

door.Touched:connect(function(hit)
if hit.Parent.Name == plr.Name then
if plr:GetRankInGroup(5206514) >= 2 then
   door:Destroy()
    end
end
end)

Did not work, I pasted it wrong also, My bad.

Thank you soo much, this works.

1 Like