donmor3000 Posted May 18, 2019 Share Posted May 18, 2019 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 More sharing options...
Winning117 Posted May 18, 2019 Share Posted May 18, 2019 (edited) 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 GLOBAL.TheNet:GetDefaultMaxPlayers() for i, v in ipairs(_G.AllPlayers) do -- check character type here Edited May 18, 2019 by Winning117 Link to comment Share on other sites More sharing options...
Developer bizziboi Posted May 18, 2019 Developer Share Posted May 18, 2019 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now