Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a save GUI?

Asked by 11 years ago

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

Log in to vote
0
Answered by 11 years ago

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.

01GoldKey = "Gold"
02 
03game.Players.PlayerAdded:connect(function(player)
04    if player:WaitForDataReady() then
05        --  That, will create your leaderboard
06        local ls = Instance.new("IntValue")
07        ls.Name = "leaderstats"
08        ls.Parent = player
09 
10        -- And this one will create your Gold stat
11        local Golded = Instance.new("IntValue")
12        Golded.Name = "Gold"
13        Golded.Parent = ls
14            Golded.Value = player:LoadNumber(GoldKey)
15    end
16end)

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 :

1GoldKey = "Gold"
2 
3function Saved()
4    if player:FindFirstChild("leaderstats") then
5        player:SaveNumber(GoldKey, player.leaderstats.Gold.Value)   
6     end
7end
8 
9script.Parent.MouseButton1Down:connect(Saved)
0
thank you jls12345678 0 — 11y
Ad

Answer this question