How do I make a invisible wall for a certain role in a group

Hello there,

I’m currently working on a cafe game for Roblox. As you know in cafe games there is an invisible wall that only employees can go through that seperates the kitchen from the rest of the cafe. I don’t know how to script or make this, I’ve tried searching for youtube tutorials but I haven’t found any. Please help.

1 Like

So you would need to check if the player is in the group and un-cancollide the door, in a localscript

local door = game.Workspace.door --Change this if you want
local groupId = 1 --Change this to the group
local player = game.Players.LocalPlayer

if player:IsInGroup(groupId) then
    door.CanCollide = false
end

You can also make multiple doors

local doors = {game.Workspace.door1, game.Workspace.door2} --Change this if you want
local groupId = 1 --Change this to the group
local player = game.Players.LocalPlayer

if player:IsInGroup(groupId) then
    for index, door in pairs(doors) do
        door.CanCollide = false
    end
end

I think he wants only the employees to get through so you would need to check their group rank as well

Oh if thats the case then:

local door = game.Workspace.door --Change this if you want
local groupId = 1 --Change this to the group
local minimumRank = 20 -- Change this
local player = game.Players.LocalPlayer

if player:GetRankInGroup(groupId) >= minimumRank then
    door.CanCollide = false
end