I have this script, where it changes the value of my leaderstats.Wins and hiddenData.unlockedWorld, but because it's a LocalScript, it doesnt save when I leave. I've tried multiple methods such as ReplicatedStorage etc.. but nothing worked, the data always gets reset. Can anybody help?
confirm.MouseButton1Up:Connect(function()
if wins.Value >= Cost then
unlockedWorld.Value = worldToBeUnlocked
wins.Value = wins.Value - Cost
mainFrame.Visible = false
-- update gui
local PlayerGui = Player.PlayerGui.ScreenGui
local winGui = PlayerGui.Wins
winGui.Text = "🏆 WINS: " .. wins.Value
end
end)
** You are now Level 11! **