Save Gui (Button Color) & (Image)

30 days daily login model

  • So I was somehow able to get this concept working.

  • Below is in short how the system works:

    – This system lets play claim daily login reward every 24 hours.
    – If player does not claim for 48 hours then it reset.
    – It saves the days count and stuff everything properly

  • So what I need help with is, I want these 2 things to be saved as in player Gui
    when the join the game and leave.

    Button Colour: Because colour of button changes after its claimed.
    Image: Because there is an “:white_check_mark:” Image which pops up after daily is claimed.


  • And there are like 30 buttons and 30 images since its 30 days system.
  • All the buttons from Reward 1 to Reward 30 Color changes after its claimed.
  • All The checks “:white_check_mark:” from Reward 1 to Reward 30 are in " CheckPopUp " Folder.
    Now please tell me the best way of saving these 2 items <33

You could use a datastore.

Store every reward that has been claimed in the datastore for the players that claimed them, load it when they join and then set the image and colour for the buttons.

I have this script from some another similar post but have no idea how to make it save my image and button color. I tried but kind of messed up.

  • So, can you tell me by editing it how I can exactly make it happen?
-- Get the services we need.
local dataStoreService = game:GetService("DataStoreService")
local players = game:GetService("Players")

-- Get when a player joins
	-- Get the player's datastore
	local ds = dataStoreService:GetDataStore(tostring(plr.UserId))
	local success, response = pcall(function()
		-- Get the value
		return ds:GetAsync("gui_visible")
	-- Check if the request failed (if not, continue)
	if (success) then
		-- Check if the value is set to true
		if (response) then
			[FRAME].Visible = true
			-- If the value is either false or it was never set
			[FRAME].Visible = false

	-- Get the player's datastore
	local ds = dataStoreService:GetDataStore(tostring(plr.UserId))
	-- Attempt to set the value
	ds:SetAsync("gui_visible", [FRAME].Visible)

unfortunately I don’t use datastores much so I can’t do the script for you exactly, but you would change [FRAME] for the colour of the gui, and create another variable for the image, could be Image and it would have a true or false value. If it was true, set the image visibility to true. For the colour, you could save the RGB and then load it

Oh hmm makes sense, I will try it out and ask you if any doubts.
Is it okay? or you can add me in discord = vampsster
I can ask you there

I sent you a request on discord

@Wizzthepixelcat Hello, what do you think buddy? can you help me with this?

@Vampsster. Hey there! Sorry for such a late reply. I had no idea you even posted anything else. I don’t specialize in this kind of thing, sorry! I hope you got this fixed though!