I'm very confused with DataStore and I'd like to know how I would rewrite this code using DataStore instead of DataPersistence.
function SaveScore(plyr, score)
plyr:SaveNumber("stage", score)
end
function onClicked()
player = script.Parent.Parent.Parent.Parent.Parent
player:WaitForDataReady()
if player.DataReady == true then
SaveScore(player, player.leaderstats:findFirstChild(script.Parent.Parent.Parent.Configuration.Type.Value).Value)
m = Instance.new("Hint",player.PlayerGui)
m.Text = script.Parent.Parent.Parent.Configuration.Type.Value.. " saved!"
game:service("Debris"):AddItem(m, 3)
else
m = Instance.new("Hint",player.PlayerGui)
m.Text = "Wait until DataReady!"
game:service("Debris"):AddItem(m, 3)
end
end
script.Parent.MouseButton1Click:connect(onClicked)

2 comments
Sure I'll help, One moment.
Thanks ok!