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 make it so I can save a value or something with async?

Well, I want an employee of the month thing in my cafe, and I want the image to be able to change and save with a gui with async, however I cant get it to work.

local DSService = game:GetService('DataStoreService'):GetDataStore('camgoucher123')
game.Players.PlayerAdded:connect(function(plr)

	-- GetAsync
	local GetSaved = DSService:GetAsync(game.Workspace.picture.SurfaceGui.ImageLabel.Image)
	if GetSaved then
		game.Workspace.picture.SurfaceGui.ImageLabel.Image = GetSaved[1]
	else
		local NumbersForSaving = {game.Workspace.picture.SurfaceGui.ImageLabel}
		DSService:SetAsync( NumbersForSaving)
	end
end)

game.Players.PlayerRemoving:connect(function(plr)

local Savetable = {game.Workspace.picture.SurfaceGui.ImageLabel.Image}
DSService:SetAsync(Savetable)	
	
	
end)

1 answer

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