Hello! I’m trying to make a group door for my hotel, but it isn’t working. I want it so all ranks with a rank ID of 4 or higher can go through this part, which is invisble.
local StaffDoor1 = game.Workspace.GroupDoor1
local StaffDoor2 = game.Workspace.GroupDoor2
local StaffDoor3 = game.Workspace.GroupDoor3
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(4880128) >=4 then
StaffDoor1.CanCollide = false
StaffDoor2.CanCollide = false
StaffDoor3.CanCollide = false
else
end
end)
I tested in studio and in game but I couldn’t walk through.
Well looking at your script. It seems like if one player joins with a ran higher or equals to 4 all of the players can come trough. Are you sure you have a Rank higher or equals to 4?
Edit: Seems like your Id goes to the group called Deluxe Hotels
I am not sure, But I think it can work with a local script, try to create a local script like this:
local StaffDoor1 = game.Workspace.GroupDoor1
local StaffDoor2 = game.Workspace.GroupDoor2
local StaffDoor3 = game.Workspace.GroupDoor3
local Player = game.Players.LocalPlayer
if Player:GetRankInGroup(4880128) >=4 then
StaffDoor1.CanCollide = false
StaffDoor2.CanCollide = false
StaffDoor3.CanCollide = false
else
end
I believe that way, Only players in the group will be able to pass the
Let me test it,I’ll edit this post
Yes, that’s what I meant Luka.
My script works fine, I did not mention that it should be in the StarterPlayerScripts because I thought it is obvious. My script works for me. I used it with my group id and just created normal parts and named them.
I’ve been wanting to implement this in my game but I was hesitant because a few developers were telling me that exploiters are able to work around this and still get past. Can anyone confirm?
minecraftxrrr No, it should be a local script for a reason, only players in the group should be able to go past it, and normal scripts can’t get LocalPlayer, if you put it in the workspace, everyone will be able to go past it, because it will be canCollide = false for everyone.
Don’t put it in a normal script.