This button when pressed should be decreasing 1 from the stage Value and adding 1 to the test Value, but it is not working yet there are no errors marked.
(ds is the datastore)
local player = game.Players.LocalPlayer
local test = player.ds.Test
local stage = player.leaderstats.Stage.Value
DB = true
function Click()
if DB == true then
DB = false
stage.Value = stage.Value -1
wait(1)
test.Value = test.Value +1
end
wait(1) -- Time until button can be pressed again.
DB = true
end
script.Parent.MouseButton1Down:connect(Click)

2 comments
I did eventually become aware of that typo but still something is not working right, I'm using this datastore :/ http://www.roblox.com/DataStore-Leaderboard-item?id=160906730
Got it to work, I'm not sure if I enabled API or if I moved line 2 and 3. Thanks though!