Hii! I’m trying to make this script to work only for higher group ranks.
I mean when they type the command, it works only for higher group ranks and not for low ranks.
Script:
function onChatted(msg, speaker)
source = string.lower(speaker.Name)
msg = string.lower(msg)
-- Note: This one is NOT caps sensitive
if msg == "!opendoor1", then
script.Parent.Transparency = 1
script.Parent.CanCollide = false
if msg == "!closedoor1", then
script.Parent.Transparency = 0
script.Parent.CanCollide = true
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)