The GUI has a LocalScript
, which will communicate with the server script using a RemoteEvent
. FilteringEnabled stops the major part of exploiters; read about it here. Both buttons has connected the click, MouseButton1Click:Connect(function)
, where the process begins.
The function you seek is RemoteEvent:FireServer(vote)
, which the vote is either a boolean or a string that is what the player voted. The button each has bound to a function when activated will pass the vote to the server.
Server reads the vote, aka the argument. The vote is added up to the value x
or not if the vote was not true.
Also the prompt of votekick is sent from client to server. Which is another additional step. Server reads the RemoteEvent
arguments, which will then find the target player.
Server will later on fire prompt to all clients to votekick.