I think I know. If an event (in this case your event) is under a loop, while true, or repeat. It completely breaks and does not run. Instead try putting your event near the top of your script, above and loops.
I would assume the PlayerAdded event didn’t fire in time.
Please double check if that fires, if not, here’s a quick fix for you.
local Players = game:GetService('Players')
local function PlayerAdded(Player)
print(('%s joined.'):format(Player.Name))
local function Chatted(Message) -- Player.Chatted only has one parameter, not two.
print(('%s said %s.'):format(Player.Name, Message))
end
Player.Chatted:Connect(Chatted)
end
local GetPlayers = Players:GetPlayers()
for i = 1, (#GetPlayers)
do
task.spawn(PlayerAdded, GetPlayers[i])
end
Players.PlayerAdded:Connect(PlayerAdded)
If you don’t provide the whole script to this code, we’ll likely not be able to solve your issue. It may seem like you don’t need to do this, but the more code showed the more we’ll be able to determine what the problem is.