game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) if msg:sub(1, 5) == "!open" or msg:sub(1, 5) == "!Open" then if plr:GetRankInGroup(5370359) >= 12 then workspace.Door.Transparency = 1 workspace.Door.CanCollide = false end end end) end) game.Players.PlayerAdded:Connect(function(plr) plr.Chatted:Connect(function(msg) if msg:sub(1, 5) == "!close" or msg:sub(1, 5) == "!Close" then if plr:GetRankInGroup(5370359) >= 12 then workspace.Door.Transparency = 1 workspace.Door.CanCollide = false end end end) end)
How do I make it so !open and !close can be used infinitely?
if msg:sub(1, 5) == "!close" or msg:sub(1, 5) == "!Close" then
The word, !close
and !Close
have 6
characters, not 5. That's your error and that's why it won't close on line 14.