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

How do I save GUI inputs with DataStore?

Asked by 4 years ago
local SC = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.SC

script.Parent.MouseButton1Click:connect(function()
    if SC.Value >= 10 then
        script.Parent["STOP MULTI"].Disabled = false
        script.Parent.BeamFunction.Disabled = false
        script.Parent.Text = "Purchase Complete!"
        wait(0.5)
        script.Parent.Text = "EQUIP"
        SC.Value = SC.Value - 10
        script.Disabled = true
        else
    end
end)

(This all works btw) Even though I know entirely how to save leaderstats and tools ect. I am just completely clueless about saving GUI things and I can't find tutorials or help anywhere.

0
You don't want to use data stores for just anything. Only things like player stats that you want to keep next time they load back in. I just want to make sure that is what you meant by "GUI things". SteamG00B 1633 — 4y
0
but how do I save when somebody buys a one time purchase with in-game currency from my shop? Ethan674833 0 — 4y
0
IntValues or BoolValues to represent something that was bought kkfilms_1 68 — 4y
0
sounds similar to leaderstats so I will check it out, thx for the help :) Ethan674833 0 — 4y

1 answer

Log in to vote
0
Answered by
imKirda 4491 Moderation Voter Community Moderator
4 years ago

So from what i've seen you want to save bool values, bool value is true/false i think you know, i recommend making a table with bools with each item if it was bought and then save the table and each time you join, you get the table content and done.

0
I have an idea how to do a table that saves but I cant seem to work out how to execute it, I was thinking that the table does something like {BeamsBought.Value,GunBought.Value,etc} and save that, but I have dont know where to store the variables. Ethan674833 0 — 4y
0
Values I mean not variables Ethan674833 0 — 4y
0
Nevermind I am dumb, I realized i could just use replicatedstorage Ethan674833 0 — 4y
Ad

Answer this question