-- remotefunctions kk
--serverscript
DS = game:GetService("DataStoreService"):GetDataStore("votes")
event = game.ReplicatedStorage.Events.VotePlayer1
event.OnServerEvent:connect(function()
DS:UpdateAsync("player1", function(oldValue) return oldValue + 1 end)
end)
-- inside the gui button
-- parenting
rs = game.ReplicatedStorage
events = rs.Events
votefunction = events:FindFirstChild("VotePlayer1")
-- script
local button = script.Parent
button.MouseButton1Down:connect(function()
votefunction:FireServer()
end)
This gives this error:
ServerScriptService.Script:13: attempt to perform arithmetic on local 'oldValue' (a nil value)
How would I define a value, this are all scripts I have..
but I have no clue how to fix this

2 comments
Thanks, you fixed it!
No problem.