I have a rank, group script which doesnt seem to be functioning correctly. The door is a command opening door which only functions when someone above the rank in the group says the command "Open/MC" it changes the transparency to 1 and turns off can-collide and when you say "Close/MC" it changes transparency to 0 and turns on can-collide. For some reason it isnt working. Parent: Door (Model) Children: Door handler (This script) - Children of this child : Open (BoolValue) Children: Door part one (Part)
Group = 2681047 -- Set the group's ID here. RequiredRank = 13 -- Anyone this rank and higher use the command. game.Players.PlayerAdded:connect(function(Player) Player.Chatted:connect(function(msg) if Player:GetRankInGroup(Group) >= RequiredRank or Player.Name == "Player" or Player.Name == "Traide" --[[ or Player.Name=='Player' --]] then if msg == 'Open/MC' then script.Parent.DoorPart1.Transparency = 1 script.Parent.DoorPart1.CanCollide = false elseif msg == 'Close/MC' then script.Parent.DoorPart1.Transparency = 0 script.Parent.DoorPart1.CanCollide = true end end end) end)