i have a remote event so when the player clicks something it votes and i have values on which one is being voted and it shows no error
script.Parent.Votes.OnServerEvent:connect(function(player, voted, selection) if selection == "p1" then script.p1.Value = script.p1.Value + 1 if voted == true then script.p2.Value = script.p2.Value - 1 end print("works") elseif selection == "p2" then script.p2.Value = script.p2.Value + 1 if voted == true then script.p1.Value = script.p1.Value - 1 end print("works") end end)
Local script
game.ReplicatedStorage.Votes2.OnClientEvent:Connect(function() script.Parent.Image = ("http://www.roblox.com/Thumbs/Avatar.ashxx=100&y=100&Format=Png&username=%s"):format(game.Workspace.CurrentDebater1.Vaule) end) script.Parent.MouseButton1Down:Connect(function() local pir = game.Players.LocalPlayer game.ReplicatedStorage.Votes:FireServer(pir , pir.Voted.Value, "p1") pir.Voted.Value = true script.Parent.TextLabel.Visible = true script.Parent.Parent.p2.TextLabel.Visible = false print("fired") end) wait(10) game.Players.LocalPlayer.Voted = false
it says fired but not works
Well when you fire your remote event, your sending pir, pir.Voted.Value, and "p1". When remote functions or events are fired, they auto send the player as a variable in the first slot. So that means you can just remove the pir from your firing event. Right now the server script thinks voted is actually pir.