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

How do I save GUI inputs with DataStore?

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.

4 comments

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".

0

but how do I save when somebody buys a one time purchase with in-game currency from my shop?

0

IntValues or BoolValues to represent something that was bought

0

sounds similar to leaderstats so I will check it out, thx for the help :)

1 answer

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.

3 comments

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.

0

Values I mean not variables

0

Nevermind I am dumb, I realized i could just use replicatedstorage

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