Is there a way to save a certain gui to a specific player so when the player leaves, the gui appears the same to that specific person?

For example, if i had a gui shop and a player pressed a 'buy' button to purchase a pet and the buy button changes to an 'equip' button, how can i make it so that it stays as an equip button for that certain player when they leaves the game?

Another example is when i have a store gui and a certain gear is locked with a locked icon, and when a player buys the gear, the locked icon would go away and they would be able to use it, how can i keep the gear unlocked for that certain player when they leaves?

--This is my Line of Code so far that is in a Local Script inside the buy button:

local player = game.Players.LocalPlayer
local gems = player:WaitForChild('leaderstats').Gems
local buyButton = script.Parent
local errorSound = game.Workspace.Error
local boughtSound = game.Workspace.ChaChing
local boughtMessage = script.Parent.Bought
local errorMessage = script.Parent.Parent.Parent.Parent.Parent.ErrorMessage
local gemImage = script.Parent.Gem

script.Parent.MouseButton1Click:connect(function()
	if gems.Value >= 50 and not player.Backpack:FindFirstChild('HyperlaserGun') and not player.StarterGear:FindFirstChild('HyperlaserGun') and not player.Character:FindFirstChild('HyperlaserGun') then
		game.Lighting.WeaponFolder.HyperlaserGun:Clone().Parent = player.Backpack
		game.Lighting.WeaponFolder.HyperlaserGun:Clone().Parent = player.StarterGear
		gems.Value = gems.Value - 50
		boughtSound:Play()
		boughtMessage.Visible = true
		gemImage.Visible = false
	else
		if player.Backpack:FindFirstChild('HyperlaserGun') or player.StarterGear:FindFirstChild('HyperlaserGun') or player.Character:FindFirstChild('HyperlaserGun') then
			errorMessage.Visible = true
			errorSound:Play()
			errorMessage.Text = 'You already own this item!'
			wait(1.5)
			errorMessage.Visible = false
			errorMessage.Text = "You don't have enough Gems to purchase this!"
		else	
		errorMessage.Visible = true
		errorSound:Play()
		wait(1.5)
		errorMessage.Visible = false			
			
		end

	end
end)

5 comments

0

Where is your attempt at this?

0

the buy/equip button example

0

^ which u didnt give :C

0

use a datastore to check if they bought it when they join the game, datastores for second thing also

0

also, he was asking "is there a way" he wasnt asking for a script. oof nvm., didnt read the title