You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Voting system
-
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 -
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.