I'm making a voting system, I'm trying to update the number value when I fire the remote. When I do fire the remote, nothing happens. Any ideas to fix this?
Server Script (there are 3 number values in replicated storage)
local RS = game:GetService("ReplicatedStorage")
RS.Vote.OnServerEvent:Connect(function(voted)
if voted == "Portal" then
RS.Poll.Portal = RS.Poll.Portal + 1
elseif voted == "Know" then
RS.Poll.Know = RS.Poll.Know + 1
elseif voted == "Human" then
RS.Poll.Human = RS.Poll.Human + 1
end
end)
Local Script
local vote = game.ReplicatedStorage.Vote
local WhatYouVoted
local debounce = false
script.Parent.Portal.Button.MouseButton1Click:Connect(function()
if debounce == false then
WhatYouVoted = "Portal"
vote:FireServer(WhatYouVoted)
debounce = true
script.Parent.Parent.Who.Visible = false
end
end)
script.Parent.Human.Button.MouseButton1Click:Connect(function()
if debounce == false then
WhatYouVoted = "Human"
vote:FireServer(WhatYouVoted)
debounce = true
script.Parent.Parent.Who.Visible = false
end
end)
script.Parent.Know.Button.MouseButton1Click:Connect(function()
if debounce == false then
WhatYouVoted = "Know"
vote:FireServer(WhatYouVoted)
debounce = true
script.Parent.Parent.Who.Visible = false
end
end)
