It's comparing a string (v.Name) to a table, it'll always be false because a string doesn't equal a table no matter what the values.
Also, you have a for loop running when "Performer" is an instance not a table. No idea why you're doing that so I just removed it.
You should write a function to check if a player is an admin (forgive my formatting, I'm writing this in the editor :P)
local function isAdmin(player)
for i, v in pairs(Admins) do
if v == player.Name then
return true
end
end
return false
end
Updated code:
local Admins = {"Player"}
local function isAdmin(player)
for i, v in pairs(Admins) do
if v == player.Name then
return true
end
end
return false
end
game.Players.PlayerAdded:connect(function(Performer)
if isAdmin(Performer) then
Performer.Chatted:connect(function(Command)
if string.sub(Command, 1, 4) == "msg/" then
local MSG = Instance.new("Message", game.Workspace)
MSG.Text = string.sub(Command, 5)
end
end)
end
end)
1 comment
There's also another error with the script, he's running a generic for loop with 'Performer', an Instance.