Why is it only showing for the first player?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

    Voting system

  2. What is the issue? Include screenshots / videos if possible!

    https://gyazo.com/645b0139a53aed78acc0567ed8342abe
    It only changes for the first player to enter. The IntValue doesn’t change for both clients although
    this is a regular script. The script is in StarterGUI with the Maps Folder

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

    I have tried, FireAllClients, RemoteEvent back to players, for count = 1, #players , for _, i in pairs(players:GetChildren()) … >> I have been been relentless in searching. This is a server script.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local Frame = script.Parent
local ScreenGui = Frame.Parent
local Voting = ScreenGui.Parent
local Rounds = Voting.Parent
local PlayerGui = Rounds.Parent
local Player = PlayerGui.Parent
local Players = game:GetService("Players")
local ArrayPlayers = Players:GetPlayers()

local FireAll = Frame.FireAll

local Map1 = Frame.Map1
local Map1RE = Map1.Map1Vote
local Map1Array = {}

local Map2 = Frame.Map2
local Map2RE = Map2.Map2Vote
local Map2Array = {}


local Map3 = Frame.Map3
local Map3RE = Map3.Map3Vote
local Map3Array = {}

local function VoteControl(map, maparray, map2, map2array, map3, map3array)
	
	for _, i in pairs(ArrayPlayers) do
		
		local Map = i.PlayerGui.Rounds.Voting.ScreenGui.Maps[map.Name]
		local MapTwo = i.PlayerGui.Rounds.Voting.ScreenGui.Maps[map2.Name]
		local MapThree = i.PlayerGui.Rounds.Voting.ScreenGui.Maps[map3.Name]
		

	
		if not table.find(maparray, Player.Name) then

			if table.find(map2array, Player.Name) then
				table.remove(map2array, table.find(map2array, Player.Name))
				MapTwo.VoteCount.Value -= 1
				MapTwo.CurrentVotes.Text = MapTwo.VoteCount.Value
			end

			if table.find(map3array, Player.Name) then
				
				table.remove(map3array, table.find(map3array, Player.Name))
				MapThree.VoteCount.Value -= 1
				MapThree.CurrentVotes.Text = MapThree.VoteCount.Value
				
			end

			Map.VoteCount.Value += 1

			table.insert(maparray, Player.Name)
			
			Map.CurrentVotes.Text = Map.VoteCount.Value
		end
		
	end
	 
	FireAll:FireAllClients(Map1.VoteCount.Value, Map2.VoteCount.Value, Map3.VoteCount.Value)
	
end

Map1RE.OnServerEvent:Connect(function(player)
	
	VoteControl(Map1, Map1Array, Map2, Map2Array, Map3, Map3Array)

end)

Map2RE.OnServerEvent:Connect(function ()
	

	VoteControl(Map2, Map2Array, Map1, Map1Array, Map3, Map3Array)

end)

Map3RE.OnServerEvent:Connect(function ()

	VoteControl(Map3, Map3Array, Map1, Map1Array, Map2, Map2Array)

end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Where is the RemoteEvent created and can you show us the client local script that responds to that event please.

2 Likes

Because you should use

for _, i in pairs(game.Players:GetChildren()) do

end

Whenever someone votes, so it will change all of their texts

2 Likes

You are setting arrayplayers when the server starts, so it only contains the first player, instead you should do game.Players:GetChildren() in the loop.

1 Like

https://gyazo.com/ae59ad0f551794e20cd7ebe4e80d917f

Its quite literally blowing my mind because when I print ‘i’ it will print both players but when I print Map it will only print one.

https://gyazo.com/ae59ad0f551794e20cd7ebe4e80d917f

This is where all of my RemoteEvents are

I gave it a shot and I’m still running into the same issue

Server scripts shouldn’t be inside of screengui’s, move the script to serverscriptservice, and move remoteevents to replicatedstorage.