Hello, I want this Group only door to have an Rank only script... How can i do this?
GroupId = 00000 --Change this to your group's ID function checkOkToLetIn(name) if game.Players[name]:IsInGroup(GroupId) == true then return true end return false end local Door = script.Parent function onTouched(hit) print("Door Hit") local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then -- A player did touch this door print("Human touched door") -- Let's see if he is in the group. if (checkOkToLetIn(human.Parent.Name)) then print("Human passed test") Door.Transparency = 0.5 --how transparent the door gets. Changable Door.CanCollide = false --you can walk through the door. wait(4) -- this is how long the door is open. Changable Door.CanCollide = true -- non-walkable Door.Transparency = 0 -- Looks closed to me! else humanoid.Health = 0 --This makes sure that if the dude is not in the group, he will be dead. Otherwise he could get in. end end end script.Parent.Touched:connect(onTouched)
GroupId = 00000 --Change this to your group's ID function checkOkToLetIn(name) 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 return false end local Door = script.Parent function onTouched(hit) print("Door Hit") local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then -- A player did touch this door print("Human touched door") -- Let's see if he is in the group. if (checkOkToLetIn(human.Parent.Name)) then print("Human passed test") Door.Transparency = 0.5 --how transparent the door gets. Changable Door.CanCollide = false --you can walk through the door. wait(4) -- this is how long the door is open. Changable Door.CanCollide = true -- non-walkable Door.Transparency = 0 -- Looks closed to me! else humanoid.Health = 0 --This makes sure that if the dude is not in the group, he will be dead. Otherwise he could get in. end end end script.Parent.Touched:connect(onTouched)