local DataStore = game:GetService("DataStoreService"):GetDataStore("AdvertSaver")
while wait(2) do
local hoursofadvert = 24
local currenttime = os.time()
local hourssincelastrun = currenttime - DataStore:GetAsync("AdvertShirt-Time")
if DataStore:GetAsync("AdvertShirt-Id") >= 1 then
if (hourssincelastrun/3600) >= hoursofadvert then
DataStore:SetAsync("AdvertShirt-Id",0)
DataStore:SetAsync("AdvertShirt-Time",0)
end
else
DataStore:SetAsync("AdvertShirt-Id",0)
DataStore:SetAsync("AdvertShirt-Time",0)
print("Shirt Id is Invalid")
end
end
COMMUNITY QUESTION
Datastore error: a nil value? [SOLVED]
1 answer
I figoured this out Solved
i didnt add data ~= nil
This discussion is preserved as it was. New answers, comments, and votes are closed.
