How would I go on about scripting a leader election system?

I don’t know where to necessarily start, what should I do to begin and what things should I focus on?

4 Likes

What do you mean? Like a voting system? You’d probably want a RemoteEvent to tell the server a player voted, and then a table of voted players, as well as variables to count how many votes each leader has.

2 Likes

i made 3 mistakes in a row, heres the actual fixed version, sorry i was rushing:

ElectionSystemActuallyFixed.rbxl (65.5 KB)

1 Like

yeah this one worked try this one

1 Like

This one is nice, but how would I go on about making it a vote for a randomly selected player thing? and how could I make it so elections happen every now and then.

for the random people get picked for election u could get the players on random and pick 2 of them then put them on election. wait im making a script to explain it

for the random player picker u could do like

local Plrs = game:GetService("Players")
local players = Plrs:GetPlayers()

Plrs.PlayerAdded:Wait()
	
local CandidateOne = players[math.random(1, #players)]
local CandidateTwo = players[math.random(1, #players)]

to make the election happens every now and then u could use a while true do statement like:

while true do
	
end
1 Like

heres teh updated version of the election system i made that u could use:

ElectionSystemVersion2.rbxl (66.1 KB)

Thank you, this has been really helpful.

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