Jump to content

Getting player logged out on a dedicated server

Recommended Posts

I'm building a mod that despawns player who selects characters already in the world, and I fails on looking for ways to get all players in the server, including those players logged out or in the cave sim. Is there any way to get the full player list or, um, disable the characters in the world at the selection screen? Appreciate a lot if someone can help.

Link to comment
Share on other sites

I believe you could loop through the player list using a for-loop, though I'm not sure what you can use to check their selected character


for i, v in ipairs(_G.AllPlayers) do
			-- check character type here


Edited by Winning117
Link to comment
Share on other sites

  • Developer

No, that would return a number I am pretty sure.

I'd look at scripts/widgets/playerlist.lua (it's what's used in the pause screen and the lobby screen), specifically PlayerList:GetPlayerTable() and work from there - although I am not sure what you mean by 'including logged out players'. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...