Kick script help

Hello, I am new to scripting and would like to know, how would i make a kick script for everyone that joins, but have an allowed table where players that are within the table can join? Thank you!

local Players		= game:GetService("Players")

local Allowed		= {
	1473581729,
	--userid,
	--userid,
	--userid,
}

local KickMessage	= "You are not allowed to access this game!"

local function OnPlayerAdded(Player: Player)
	print(Player.Name, Player.UserId, "joined")
	if table.find(Allowed, Player.UserId) then
		print(Player.Name, "is allowed")
	else
		Player:Kick(KickMessage)
	end
end

Players.PlayerAdded:Connect(OnPlayerAdded)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.