I’m trying to make it so there’s a timer thing. If you beat your old record logged in the datastore, the old one gets deleted and the new one replaces it. Otherwise, nothing happens.
I’ve tried solutions for it, but they haven’t worked.
My current code:
ReplicatedStorage.SaveTimerEvent.OnServerEvent:Connect(function(player, labelText)
local success, errorMessage = pcall(function()
timerStore:SetAsync(player.UserId, labelText)
end)
if success then
print("Successfully printed")
else
if not success then
warn("Error with printing. Error: ", errorMessage)
end
end
end)