When a player presses a button an event will fire, then a script will read when that event fires and change a value (the vote count), then send an event back to a local script to change the display count on a text button. My count value is called value so that is why I use Value.Value (ik it's weird)
Local script
Value = script.Parent.Value script.Parent.Text = Value.Value game.ReplicatedStorage.Vote1.OnClientEvent:Connect(function() script.Parent.Text = Value.Value end)
Normal script
game.ReplicatedStorage.Vote.OnServerEvent:Connect(function() game.StarterGui.ScreenGui.Votes.Value.Value = game.StarterGui.ScreenGui.Votes.Value.Value + 1 game.ReplicatedStorage.Vote1:FireClient() end)
There are two errors. At line 2 of the 2nd script, you should change the value of every Player's gui, and not in the Starter gui. To do that, we need to get the player. How? Like this:
game.ReplicatedStorage.Vote.OnServerEvent:Connect(function(player) for i, v in pairs (game.Players:GetChildren()) do v.PlayerGui.Votes.Value.Value = v.PlayerGui.Votes.Value.Value +1 end game.ReplicatedStorage.Vote1:FireAllClients() end)
Also, you have to change the GUI text of every players. So I added a :FireAllClients() instead of :FireClient().
If you really just wanna use :FireClient(), you have to include the player between the brackets. Like this
FireClient(player)
Also, in the local script, you made a variable at line 3 that gets the value. The problem is that the Value never changes, because you just get it once. Instead, put line 3 inside the function OnServerEvent so it upgrades every time. Make sure to also put line 1 into the function, because line 3 uses line 1's variable, so line 1's variable needs to also change.
Hope this helped!