Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

PlayerAddedEarly event - how can I use it?

If I were to code the following:

Allowed = {"XanthicDragon", "InsertNameHere"}
k = false

function KickRandomPlayer()
	local Players = game:GetService("Players").NumPlayers --Is that the variable? I may be wrong
	local random = math.random(1, Players)
	game.Players:GetChildren()[random]:Kick()
end

game:GetService("Players").PlayerAddedEarly:connect(function (Player)
	for _,v in ipairs(Allowed) do
		if Player.Name == v then
			k = true
		end
	end
	if k then
		KickRandomPlayer()
		k = false
	end
end)

Would this event fire and kick a random player if one of the players found in "Allowed" were attempting to join a full server?

2 answers

No. While the event apparently exists, it also is apparently locked.

You will not be able to use it.

This discussion is preserved as it was. New answers, comments, and votes are closed.