Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i make a save GUI?

Hi ive being trying to make a save GUI but it dosent seem to work out ive tried everything from the free models what should i do the value name is "Money" can someone plz help me

1 answer

✓ Accepted answer

After you save something you'll have to load it too. Make a simple Script and throw it at the Workspace.

Start by making the Gold value and the leaderstats. Every Time the player enters the game the Gold Value will be the one of the Key we will save.

GoldKey = "Gold"
 
game.Players.PlayerAdded:connect(function(player)
    if player:WaitForDataReady() then
	    --  That, will create your leaderboard
	    local ls = Instance.new("IntValue")
	    ls.Name = "leaderstats"
	    ls.Parent = player

	    -- And this one will create your Gold stat
	    local Golded = Instance.new("IntValue")
	    Golded.Name = "Gold"
	    Golded.Parent = ls
            Golded.Value = player:LoadNumber(GoldKey)
    end
end)

Now for the save button create a ScreenGui and put it inside the StarterGui folder. Insert the a button into it and a normal script with that code :

GoldKey = "Gold"

function Saved()
	if player:FindFirstChild("leaderstats") then
		player:SaveNumber(GoldKey, player.leaderstats.Gold.Value)    
	 end
end

script.Parent.MouseButton1Down:connect(Saved)

1 comment

0

thank you

This discussion is preserved as it was. New answers, comments, and votes are closed.