I have this script that makes a random date and saves that date. But I think there could be a better way to organize than what I have written to do this.
function setBuyerInfo(buyer)
local function date()
local r=math.round
local _r=math.random
local dates={
[1]={
d=r(_r(1,31)).."/",
m=r(_r(1,12)).."/",
y=r(_r(2300,2399))
},
[2]={
d=r(_r(1,31)).."/",
m=r(_r(1,12)).."/",
y=r(_r(2300,2399))
}
}
for i,_date in dates do
local y1=dates[1].y
local y2=dates[2].y
if y2<y1 then
repeat
task.wait()
y2=r(_r(2300,2399))
until y2>y1
dates[2].y=y2
end
end
local returningTable={}
if table.find(mdyCountries,player.Country) then
returningTable={
[1]=dates[1].m..dates[1].d..dates[1].y,
[2]=dates[2].m..dates[2].d..dates[2].y
}
else
returningTable={
[1]=dates[1].d..dates[1].m..dates[1].y,
[2]=dates[2].d..dates[2].m..dates[2].y
}
end
return returningTable
end
local returningDate=date()
local dates={
[1]="Date Of Purchase: "..returningDate[1],
[2]="Expected Arrival: "..returningDate[2]
}
if buyer=="callisto" then
buyerInfo.BuyerName.Text="Buyer Name: Callisto Corperation"
buyerInfo.Region.Text="Region: Vega"
buyerInfo._Name.Text="Name: "..Players:GetNameFromUserIdAsync(1259467892)
if buyerDates["callisto"] then
buyerInfo.PurchaseDate.Text=buyerDates["callisto"][1]
buyerInfo.TimedArrival.Text=buyerDates["callisto"][2]
else
buyerInfo.PurchaseDate.Text=dates[1]
buyerInfo.TimedArrival.Text=dates[2]
buyerDates["callisto"]=dates
end
elseif buyer=="innovation" then
buyerInfo.BuyerName.Text="Buyer Name: Innovation Incorporated"
buyerInfo.Region.Text="Region: Caelum"
buyerInfo._Name.Text="Name: "..Players:GetNameFromUserIdAsync(799258)
if buyerDates["innovation"] then
buyerInfo.PurchaseDate.Text=buyerDates["innovation"][1]
buyerInfo.TimedArrival.Text=buyerDates["innovation"][2]
else
buyerInfo.PurchaseDate.Text=dates[1]
buyerInfo.TimedArrival.Text=dates[2]
buyerDates["innovation"]=dates
end
elseif buyer=="kingslayer" then
buyerInfo.BuyerName.Text="Buyer Name: United States Intelligence Community"
buyerInfo.Region.Text="Region: Northern America"
buyerInfo._Name.Text="Name: Nomad"
if buyerDates["kingslayer"] then
buyerInfo.PurchaseDate.Text=buyerDates["kingslayer"][1]
buyerInfo.TimedArrival.Text=buyerDates["kingslayer"][2]
else
buyerInfo.PurchaseDate.Text=dates[1]
buyerInfo.TimedArrival.Text=dates[2]
buyerDates["kingslayer"]=dates
end
elseif buyer=="nasa" then
buyerInfo.BuyerName.Text="Buyer Name: National Aeronautics And Space Administration"
buyerInfo.Region.Text="Region: Andromeda"
buyerInfo._Name.Text="Name: Dwight Eisenhower"
if buyerDates["nasa"] then
buyerInfo.PurchaseDate.Text=buyerDates["nasa"][1]
buyerInfo.TimedArrival.Text=buyerDates["nasa"][2]
else
buyerInfo.PurchaseDate.Text=dates[1]
buyerInfo.TimedArrival.Text=dates[2]
buyerDates["nasa"]=dates
end
elseif buyer=="ray" then
buyerInfo.BuyerName.Text="Buyer Name: Rey Industries Incorporated"
buyerInfo.Region.Text="Region: The Void"
buyerInfo._Name.Text="Name: "..Players:GetNameFromUserIdAsync(553619003)
if buyerDates["ray"] then
buyerInfo.PurchaseDate.Text=buyerDates["ray"][1]
buyerInfo.TimedArrival.Text=buyerDates["ray"][2]
else
buyerInfo.PurchaseDate.Text=dates[1]
buyerInfo.TimedArrival.Text=dates[2]
buyerDates["ray"]=dates
end
end
end
Any ideas?