[HELP] i need a script who kick an random player

when i join in my server when it is 32/32 kick an random player
i really need this script

I’m sure there’s an admin script out there that does what you’re looking for.
However, I am learning to script so here is my crack at it.

server.lua
AddEventHandler("rconCommand", function(theCommand)
	if theCommand == "kickRandomPlayer" then
		players = GetPlayers()
		if (#players >=31) then
			DropPlayer(players[math.random(1,31)])
		end
	end
end)
1 Like

or you could whitelist the person so they would always get in without the command

i found this script

						-- Start reserved slot
						local onlinePlayers = GetNumPlayerIndices()

						vRP.isViped(user_id, function(viped)           -- Check if is vip
							if onlinePlayers>=32 and viped == 1 then        -- online players
              
							  -- kick player random -- ???

							  Citizen.Wait(1000)
							elseif onlinePlayers>=32 and viped == 0 then
							deferrals.done("KingsRolePlay: Server full...")
							CancelEvent()
							
							
							end
						  end) -- End Reserved slot

Where i configure this vRP.isViped i really need help

i made one now, i just have to finnish some stuff up and i will release it :slight_smile:

Ty man you are awesome

what a dumb idea!

(20 Char)

are u finish ?