The error I am getting: 20:37:30.742 - Trying to call method on object of type: Players with incorrect arguments.
My code is:
local Admins = {"OldBo5"}
local Prefix = ":"
for v,i in ipairs(Admins) do
game.Players(Admins)[i].Chatted:Connect(function(msg)
if msg:lower() == Prefix .. "ff admins" then
for v,i in pairs(game.Players[Admins]:GetChildren()) do
local ff = Instance.new("ForceField")
ff.Parent = i.Character
ff.Name = "ForceField"
end
if msg:lower() == Prefix .. "kill admins" then
for v,i in pairs(game.Players[Admins]:GetChildren()) do
i.Character.Humanoid.Health = 0
end
if msg:lower() == Prefix .. "god admins" then
for v,i in pairs(game.Players[Admins]:GetChildren()) do
i.Character.Humanoid.MaxHealth = math.huge
wait(1)
i.Character.Humanoid.Health = math.huge
end
end
if msg:lower() == Prefix .. "ungod admins" then
for v,i in pairs(game.Players[Admins]:GetChildren()) do
i.Character.Humanoid.MaxHealth = 100
wait(1)
i.Character.Humanoid.Health = 100
end
end
if msg:lower() == Prefix .. "unff admins" then
for v,i in pairs(game.Players[Admins]:GetChildren()) do
local ff = i.Character:findFirstChild("ForceField")
ff:Destroy()
end
end
end
end
end)
end
Please help!

2 comments
You can't fire "Chatted" event from the client.
My bad, never used Chatted for a very long time.