PlrAdded not working?

local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))

local Message= ChatService:AddSpeaker("System")
Message:JoinChannel("All")

Message:SetExtraData("NameColor", Color3.fromRGB(87, 87, 87))
Message:SetExtraData("ChatColor", Color3.fromRGB(187, 187, 187))
Message:SayMessage("ROBLOX Just Joined!", "All")

game.Players.PlayerAdded:Connect(function(plr)
	print("AAAAAAAAAAA")
end)

so the code does not print “AAAAAAAAAAA” for some reason idk why but yea send help

Are you sure the script is enabled? Also, is it a Server Script or LocalScipt. Where is it placed (e.g. Workspace, ServerScriptService)?

you need to get the Service

so basically:

local Players = game:GetService("Players")

dude it is bruh i cant be that stupid now

still doesn’t work fsr or another

its giving me no response at all no error no nothing out side the playeradded function everything works

and no i am not running the game

Where have you placed your script?

SSS (ServerScriptService)

Try placing the plrAdded event at the start of the function.
You are using WaitForChild() at the top, so it could be that the game loaded the player before the chat, causing the event to not detect it

The script runs after the first player is added(due to the require at the top taking time to run), therefore it wont fire the PlayerAdded event. To fix the issue, you have to create a PlayerAdded function and run it for each player currently in the game:

local Players = game:GetService("Players")

function PlayerAdded(player)
	print("AAAAAAAAAAA")
end 

--current players
for _, player in pairs(Players:GetPlayers()) do 
	PlayerAdded(player) --may want to pcall if the function can error
end
--new players being added
Players.PlayerAdded:Connect(PlayerAdded) --no reason to pcall this(assuming your code snippet can't yield)
2 Likes

wait nvm i got it thanks it works

I am just stupid

YUP!
image

1 Like