I need help with a warning system datastore, I have the warning commands done, they work I just need them to save now/

I’ve created my own WARNING system all alone.

The thing is I’m having a lot of trouble creating a working datastore script/autosave script which saves the warnings for max 2 hours then wipes the data. It’ll load your warnings (overhead ui) in any server but for some reason it doesn’t load the warnings and I cant find any error in the output or console.

Are you having the trouble with the data store not saving? If so, you can do:

local DDS = game:GetService(‘DataStoreService’)
local WarnStore = DDS:GetDataStore(‘WarnStore’)

local function GetWarn(Player)
    local Success, Result = pcall(function()
        return WarnStore:GetAsync(tostring(Player.UserId, “Something”);
    end)

    if Success then --see if datastore request was successful
        if Result then --check if any data for the player was found
           if Result.WarnStart + Result.WarnDuration < os.time() then --check if temp warn duration is over
              return true;
          else
             return false;
          end
       end
    end
end

Please note that this exact script isn’t going to work for you. You just need to to basically run:

WarnStore:SetAsync(values) — save data store 

WarnStore:GetAsync(values) — Gets the data

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.