Trouble with datasaving rn

	PlayerYes.Team = game.Teams.Imprisoned
	PlayerYes:LoadCharacter()
	PlayerYes.PlayerGui.ImprisonedGui.Enabled = true
	PlayerYes:WaitForChild("TimeAwesome").Value = PlayerYes:WaitForChild("TimeAwesome").Value + 56

	local timeRemaining = 56
	
	while timeRemaining > 0 do
		wait(1)
		timeRemaining = timeRemaining - 1
		PlayerYes:WaitForChild("TimeAwesome").Value = PlayerYes:WaitForChild("TimeAwesome").Value - 1
	end
	PlayerYes.Team = game.Teams.Hunters
	PlayerYes:LoadCharacter()
	PlayerYes.PlayerGui.ImprisonedGui.Enabled = false

	game.Players.PlayerAdded:Connect(function(PlaIo)
		data = TiDa:GetAsync(PlaIo, PlaIo.TimeAwesome.Value)

		local timeRemaining = data
		local newThing = coroutine.create(function()
			while timeRemaining > 0 do
				wait(1)
				timeRemaining = timeRemaining - 1
				PlaIo:WaitForChild("TimeAwesome").Value = PlaIo:WaitForChild("TimeAwesome").Value - 1
			end
			coroutine.resume(newThing)
			PlaIo.Team = game.Teams.Hunters
			PlaIo:LoadCharacter()
			PlaIo.PlayerGui.ImprisonedGui.Enabled = false
		end)
	end)

	game.Players.PlayerRemoving:Connect(function(PlaDa)
		local data = PlaDa.TimeAwesome.Value
		TiDa:SetAsync(PlaDa, data)
	end)

The problem is, when I load into the game after being arrested it didn’t load the data. I want it so where if you leave and rejoin you’re still and jail and continues the timer after joining.

1 Like

please move this to #help-and-feedback:scripting-support

1 Like

done, thank you for the notice my friend

GetAsync only has one parameter: the key.

Try that first.

1 Like

lets see, thank you, lemme try it rn

I’d recommend looking through the API Documentation of the DataStoreService. It can be found at the link provided below.