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