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.