How do I make a rank door

How do I make a rank door that when I touch it gives me a helmet

There are many posts on this forum about rank doors. Have you tried searching? What have you found?

Try modifying those to do what you want.

1 Like

Have you tried using this?

https://developer.roblox.com/en-us/api-reference/function/Player/GetRankInGroup

Then if it’s below the certain rank then it will end but if not then an event will trigger opening the door.

2 Likes

Use Players:GetPlayerFromCharacter to get the player who touched the door and Player:GetRankInGroup to get their rank.

part.Touched:Connect(function(hit)
    local player = Players:GetPlayerFromCharacter(hit.Parent)

    if player and player:GetRankInGroup(groupid) >= rankid then
        -- give helmet
    end
end)
1 Like

Not really the ideal way to handle this, allows for players who aren’t the correct rank to get through when a player with the right rank touches the door. Instead you should just disables collisions locally on the client when the player joins the game.

For giving a player a helmet this would be fine, but for the door it would cause some issues.

2 Likes