I’ve tried to make a script so when you touch a door it will only open for a certain rank in a door, however I couldn’t figure out how.
3 Likes
local doorpart = script.Parent -- Put the part acting as the door here
local id = 1111 -- Put your group id here
doorpart.Touched:Connect(function(touchPart)
if touchPart.Parent:FindFirstChild("Humanoid") then
plr = game.Players:FindFirstChild(touchPart.Parent.Name)
if plr:IsInGroup(id) then
doorpart.CanCollide = false
end
end
end
Can you also make it so it will open for a certain rank in the group?
1 Like
1 Like
local doorpart = script.Parent -- Put the part acting as the door here
local id = 1111 -- Put your group id here
local minimumRankLevel = 10 -- Put your desired minimum rank level here
doorpart.Touched:Connect(function(touchPart)
if touchPart.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(touchPart.Parent.Name)
if plr:IsInGroup(id) and plr:GetRankInGroup(id) >= minimumRankLevel then
doorpart.CanCollide = false
end
end
end)
4 Likes
that is actually much smaller than mine, mind if I use it too?
yeah you can use it i dont mind
1 Like