2 easy errors in it:
WaitForChild() won't let anything after it run until the child is found.
the function is created after it's called.
I'd suggest doing something like this:
Moderators = {"CaptainSource"}
function progressCommand(player,message)
if message == "lol" then
print(speaker.Name)
end
end
game.Players.PlayerAdded:connect(function(player)
for i,v in pairs(Moderators) do
if v == player.Name then
player.Chatted:connect(function(message)
progressCommand(player,message)
end)
end
end
end)
Alt. of Jetta765214 |