Hey, I’m trying to make my own admin system, I was making the part where it handles commands and for some odd reason the Player.Chatted event isn’t firing, even though the banlist check already worked. I’ve tested it and tried to fix it multiple times and looked through the dev forum but none of them were what I was looking for.
Here is the entire source code of the module itself.
local Services = {
TextService = game:GetService("TextService"),
ReplicatedFirst = game:GetService("ReplicatedFirst"),
Players = game:GetService("Players")
}
local Core = {
RankIndexes = {
[0] = "NonAdmin",
[1] = "VIP",
[2] = "Moderator",
[3] = "Admin",
[4] = "HeadAdmin",
[5] = "Owner",
},
}
Core.__index = Core
local Directories = {
Storage = script:WaitForChild("Storage"),
Modules = script:WaitForChild("Modules"),
Shared = script:WaitForChild("Shared"),
LocateToServices = script:WaitForChild("LocateToServices"),
}
local Modules = {
DataStore2 = require(Directories.Shared:WaitForChild("DataStore2")),
}
Core.new = function(Configuration)
local Client = script:WaitForChild("Client"):Clone()
Client.Archivable = false
Client.Parent = Services.ReplicatedFirst
return setmetatable({
Configuration = Configuration,
},Core)
end
_G.Ellipse = {
Core,
Directories = Directories,
Modules = Modules,
}
function Core:Initiate()
self.Methods = {}
self.Connections = {}
self.Methods.PlayerAdded = function(plr:Player)
if table.find(self.Configuration.Banned,plr.UserId) ~= nil or table.find(self.Configuration.Banned,plr.Name) ~= nil then
plr:Kick("\n"..self.Configuration.BanListMessage)
return
end
plr.Chatted:Connect(function(msg)
print(msg)
end)
end
for _, service in pairs(Directories.LocateToServices:GetChildren()) do
if game:FindFirstChild(service.Name) ~= nil then
for _, item in pairs(service:GetChildren()) do
item:Clone().Parent = game:GetService(service.Name)
end
end
end
self.Connections.PlayerAdded = Services.Players.PlayerAdded:Connect(self.Methods.PlayerAdded)
task.wait(0.3)
for _, plr in pairs(Services.Players:GetPlayers()) do
self.Methods.PlayerAdded(plr)
end
_G.Ellipse.Configuration = self.Configuration
end
return Core
(And yes, I tried out OOP on this module.)
The “print(msg)” line doesn’t print anything in my output, which could mean that it isn’t firing.
No errors are in the output as well, so that’s another problem.
Can anyone tell me what’s wrong with this? Thanks.
EDIT: I won’t pay attention to this post anymore because I am going to rewrite it now.