How Can I Make this Group only Door to be able only Certain Ranks can Enter?
Hello,
I want this Group only door to have an Rank only script... How can i do this?
03 | function checkOkToLetIn(name) |
04 | if game.Players [ name ] :IsInGroup(GroupId) = = true then return true end |
08 | local Door = script.Parent |
10 | function onTouched(hit) |
12 | local human = hit.Parent:findFirstChild( "Humanoid" ) |
13 | if (human ~ = nil ) then |
15 | print ( "Human touched door" ) |
17 | if (checkOkToLetIn(human.Parent.Name)) then |
18 | print ( "Human passed test" ) |
19 | Door.Transparency = 0.5 |
20 | Door.CanCollide = false |
22 | Door.CanCollide = true |
24 | else humanoid.Health = 0 |
29 | script.Parent.Touched:connect(onTouched) |