how to make a player join / left script code example

Example: how to make a player join / left script

CreateMessage = function(text, color, font, size)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = text;
	Color = color;
	Font = font;
	FontSize = size;
	})
end

game.Players.PlayerAdded:connect(function(plr)
	spawn(function()
		CreateMessage(plr.Name.." has joined the game!", Color3.new(255/255, 230/255, 34/255), Enum.Font.SourceSans, Enum.FontSize.Size24)
	end)
end)

game.Players.PlayerRemoving:connect(function(plr)
	CreateMessage(plr.Name.." has left the game!", Color3.new(255/255, 88/255, 88/255), Enum.Font.SourceSans, Enum.FontSize.Size24)
end) --Script By Rigby#9052 on Discord or "JUB0T" On Roblox

Tags:

Misc Example