[Help]: Need help making a voting out player system

Hello, Sub Zero story developer here!

I am currently 10% done with the game, but ran into something that I just didn’t know how to script. I want to make a system where a GUI comes up, and lists all the players in the game [but themselves and as a text button].

The player with the most votes on the GUI, will be executed. [But I want to add extra function to it. Like teleport the player, make it look like a ghost etc.] It obviously wouldn’t run with 2 players or less.

I don’t know how to do this, and bit off more than I could chew whilst planning the game! It’s a feature I’ve put off too long, and can’t put it off much longer.

Could somebody help with this? Thanks. There is a video here. See the timestamps: 4:00 to 4:37

Anyone that can help with a full solution and or source code will be fully recognized in the end credits of the game.

If you plan on making this list of players ONLY with players that are ON THE CURRENT SERVER you can simply collect their names in a loop on the server:

local TabPlayers = {}
for _, Player in ipairs(Players:GetPlayers()) do
	TabPlayers[Player.Name] = Player.UserId
end

Or something like that.
Now, if you want to create a list that adds up ALL users that are online on ALL servers, who wants to work with Messaging Services, Memory Store, Data Store, or other techniques.

I made a tutorial about that here if you want to read and modify it to your votekick system(totally not self promoting :ok_hand:)

You could use this and make it so that you send an array of names through the module and whatever player name the module returns will be the player that gets voted out

3 Likes