Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Can I Make this Group only Door to be able only Certain Ranks can Enter?

Asked by 10 years ago

Hello, I want this Group only door to have an Rank only script... How can i do this?

01GroupId = 00000 --Change this to your group's ID
02 
03function checkOkToLetIn(name)
04    if game.Players[name]:IsInGroup(GroupId) == true then return true end
05    return false
06end
07 
08local Door = script.Parent
09 
10function onTouched(hit)
11    print("Door Hit")
12    local human = hit.Parent:findFirstChild("Humanoid")
13    if (human ~= nil ) then
14        -- A player did touch this door
15        print("Human touched door")
View all 29 lines...
0
if PLAYER:GetRankInGroup(ID) >= NUMBER then --This gets the Rank from the Group that which the player is in, edit it however you want. TheeDeathCaster 2368 — 10y

1 answer

Log in to vote
2
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago
01GroupId = 00000 --Change this to your group's ID
02 
03function checkOkToLetIn(name)
04    if game.Players[name]:IsInGroup(GroupId) == true and game.Players[name]:GetRankInGroup(GroupId) >= 2 then return true end -- the number 2 represents the Rank number. It ranges from 1-255
05    return false
06end
07 
08local Door = script.Parent
09 
10function onTouched(hit)
11    print("Door Hit")
12    local human = hit.Parent:findFirstChild("Humanoid")
13    if (human ~= nil ) then
14        -- A player did touch this door
15        print("Human touched door")
View all 29 lines...
Ad

Answer this question