Hello Developers!
I am currently finding a few issues with join messages.
If you know a way I can Modify the scripts to not repeat on player death, please tell me. The Messages Repeat Upon Player Death(s)
Server Join Message Script Issue; When a player dies, the message system responds back in the chat with the history of players that joined after you, every single player name is said again.
onPlayerJoin Script:
local players = game.Players
local gui = game.StarterGui
function onPlayerAdded(player)
gui:SetCore("ChatMakeSystemMessage", {
Text = ("[Server]: " ..player.DisplayName.. " has joined the experience");
Color = Color3.fromRGB(85, 0, 127);
Font = Enum.Font.SourceSansBold;
FontSize = Enum.FontSize.Size18;
})
end
players.PlayerAdded:Connect(onPlayerAdded)
for _,player in pairs(players:GetPlayers()) do
onPlayerAdded(player)
end
1.) Where is this script located in the hierarchy of your game?
2.) Why are you looping through every player and running the join message? If you only want it displayed on player join you don’t need to do that.
Is this somewhere in starter player? If it is then when a player dies the script will be recreated again and this might cause it to run every time they die.
You don’t need a () here since you’re just passing the function object into Connect rather than actually calling it.
The StarterGui clones everything inside it into a player’s PlayerGui whenever their character is added. Maybe change the parent of the script to StarterPlayerScripts.