Advertisement
scriptingtales

Random Date Generator Roblox on a Part

Oct 31st, 2023 (edited)
825
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.42 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4.     local env = getfenv(func)
  5.     local newenv = setmetatable({},{
  6.         __index = function(self,k)
  7.             if k=="script" then
  8.                 return var
  9.             else
  10.                 return env[k]
  11.             end
  12.         end,
  13.     })
  14.     setfenv(func,newenv)
  15.     return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Part0 = Instance.new("Part")
  20. UICorner0 = Instance.new("UICorner")
  21. SurfaceGui1 = Instance.new("SurfaceGui")
  22. Frame2 = Instance.new("Frame")
  23. TextButton3 = Instance.new("TextButton")
  24. Script4 = Instance.new("Script")
  25. TextLabel5 = Instance.new("TextLabel")
  26. TextLabel6 = Instance.new("TextLabel")
  27. TextLabel7 = Instance.new("TextLabel")
  28. TextLabel8 = Instance.new("TextLabel")
  29. TextLabel9 = Instance.new("TextLabel")
  30. Folder10 = Instance.new("Folder")
  31. TextLabel11 = Instance.new("TextLabel")
  32. TextLabel12 = Instance.new("TextLabel")
  33. TextLabel13 = Instance.new("TextLabel")
  34. TextLabel14 = Instance.new("TextLabel")
  35. TextLabel15 = Instance.new("TextLabel")
  36. Script16 = Instance.new("Script")
  37. TextLabel17 = Instance.new("TextLabel")
  38. Part0.Name = "Hold"
  39. Part0.Parent = mas
  40. Part0.CFrame = CFrame.new(3, 5.99999714, -5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  41. Part0.Position = Vector3.new(0, 6, 15)
  42. Part0.Size = Vector3.new(18, 12, 1)
  43. Part0.Anchored = true
  44. Part0.BackSurface = Enum.SurfaceType.Studs
  45. Part0.BottomSurface = Enum.SurfaceType.Studs
  46. Part0.FrontSurface = Enum.SurfaceType.Studs
  47. Part0.LeftSurface = Enum.SurfaceType.Studs
  48. Part0.RightSurface = Enum.SurfaceType.Studs
  49. SurfaceGui1.Parent = Part0
  50. SurfaceGui1.ClipsDescendants = true
  51. SurfaceGui1.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  52. SurfaceGui1.Adornee = Part0
  53. Frame2.Parent = SurfaceGui1
  54. Frame2.Size = UDim2.new(0, 900, 0, 600)
  55. Frame2.Active = true
  56. Frame2.BackgroundColor = BrickColor.new("Institutional white")
  57. Frame2.BackgroundColor3 = Color3.new(1, 1, 1)
  58. Frame2.BorderColor = BrickColor.new("Institutional white")
  59. Frame2.BorderColor3 = Color3.new(1, 1, 1)
  60. Frame2.Draggable = true
  61. Frame2.Selectable = true
  62. TextButton3.Name = "Generator"
  63. TextButton3.Parent = Frame2
  64. TextButton3.Position = UDim2.new(0.36500001, 0, 0.701666653, 0)
  65. TextButton3.Size = UDim2.new(0, 250, 0, 100)
  66. TextButton3.BackgroundColor = BrickColor.new("Silver flip/flop")
  67. TextButton3.BackgroundColor3 = Color3.new(0.533333, 0.533333, 0.533333)
  68. TextButton3.Font = Enum.Font.SourceSansLight
  69. TextButton3.FontSize = Enum.FontSize.Size14
  70. TextButton3.Text = "Generate Random Date"
  71. TextButton3.TextColor = BrickColor.new("Institutional white")
  72. TextButton3.TextColor3 = Color3.new(1, 1, 1)
  73. TextButton3.TextScaled = true
  74. TextButton3.TextSize = 14
  75. TextButton3.TextWrap = true
  76. TextButton3.TextWrapped = true
  77. Script4.Name = "ClickScript"
  78. Script4.Parent = TextButton3
  79. UICorner0.Parent = TextButton3
  80. SurfaceGui1.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
  81. table.insert(cors,sandbox(Script4,function()
  82. function onClicked()
  83.     local MonthRandomizer = math.random(1, 12)
  84.  
  85.     local DayRandomizer = math.random(1, 31)
  86.  
  87.  
  88.     local DayFEBrandomizer = math.random(1, 28)
  89.     local DayFEBLEAPrandomizer = math.random(1, 29)
  90.  
  91.  
  92.     local YearRandomizer = math.random(1600, 2100)
  93.  
  94.  
  95.  
  96.     local MonthText = script.Parent.Parent.Month.Text
  97.  
  98.     local DayText = script.Parent.Parent.Day.Text
  99.  
  100.     local YearText = script.Parent.Parent.Year.Text
  101.  
  102.  
  103.  
  104.     local MonthTextNAL = script.Parent.Parent.NalFolder.MonthNal.Text
  105.  
  106.     local DayTextNAL = script.Parent.Parent.NalFolder.DayNAL.Text
  107.  
  108.     local YearTextNal = script.Parent.Parent.NalFolder.YearNAL.Text
  109.  
  110.  
  111.  
  112.     local January = 1
  113.     local February = 2
  114.     local March = 3
  115.     local April = 4
  116.     local May = 5
  117.     local June = 6
  118.     local July = 7
  119.     local August = 8
  120.     local September = 9
  121.     local October = 10
  122.     local November = 11
  123.     local December = 12
  124.  
  125.     script.Parent.Parent.Day.Text = DayRandomizer
  126.  
  127.     script.Parent.Parent.Month.Text = MonthRandomizer
  128.  
  129.     script.Parent.Parent.Year.Text = YearRandomizer
  130.  
  131.  
  132.     -------------------- SEPARATOR ---------------------   
  133.  
  134.  
  135.     script.Parent.Parent.NalFolder.DayNAL.Text = DayRandomizer
  136.  
  137.     script.Parent.Parent.NalFolder.MonthNal.Text = MonthRandomizer
  138.  
  139.     script.Parent.Parent.NalFolder.YearNAL.Text = YearRandomizer
  140.  
  141.  
  142.  
  143.  
  144.     local JanuaryTEXT = "Jan"
  145.     local FebruaryTEXT = "Feb"
  146.     local MarchTEXT = "Mar"
  147.     local AprilTEXT = "Apr"
  148.     local MayTEXT = "May"
  149.     local JuneTEXT = "Jun"
  150.     local JulyTEXT = "Jul"
  151.     local AugustTEXT = "Aug"
  152.     local SeptemberTEXT = "Sept"
  153.     local OctoberTEXT = "Oct"
  154.     local NovemberTEXT = "Nov"
  155.     local DecemberTEXT = "Dec"
  156.  
  157.  
  158.  
  159.  
  160.     if MonthRandomizer == 1 then
  161.         script.Parent.Parent.NalFolder.MonthNal.Text = JanuaryTEXT
  162.     end
  163.  
  164.     if MonthRandomizer == 2 then
  165.         script.Parent.Parent.NalFolder.MonthNal.Text = FebruaryTEXT
  166.         if MonthText == FebruaryTEXT then
  167.             DayText = DayFEBrandomizer
  168.             if YearRandomizer % 4 == 0 then
  169.                 if YearRandomizer % 100 == 0 then
  170.                     if YearRandomizer % 400 == 0 then
  171.  
  172.                     end
  173.                 end
  174.             else
  175.  
  176.             end
  177.         end
  178.     end
  179.  
  180.     if MonthRandomizer == 3 then
  181.         script.Parent.Parent.NalFolder.MonthNal.Text = MarchTEXT
  182.     end
  183.  
  184.     if MonthRandomizer == 4 then
  185.         script.Parent.Parent.NalFolder.MonthNal.Text = AprilTEXT
  186.     end
  187.  
  188.     if MonthRandomizer == 5 then
  189.         script.Parent.Parent.NalFolder.MonthNal.Text = MayTEXT
  190.     end
  191.  
  192.     if MonthRandomizer == 6 then
  193.         script.Parent.Parent.NalFolder.MonthNal.Text = JuneTEXT
  194.     end
  195.  
  196.     if MonthRandomizer == 7 then
  197.         script.Parent.Parent.NalFolder.MonthNal.Text = JulyTEXT
  198.     end
  199.  
  200.     if MonthRandomizer == 8 then
  201.         script.Parent.Parent.NalFolder.MonthNal.Text = AugustTEXT
  202.     end
  203.  
  204.     if MonthRandomizer == 9 then
  205.         script.Parent.Parent.NalFolder.MonthNal.Text = SeptemberTEXT
  206.     end
  207.  
  208.     if MonthRandomizer == 10 then
  209.         script.Parent.Parent.NalFolder.MonthNal.Text = OctoberTEXT
  210.     end
  211.  
  212.     if MonthRandomizer == 11 then
  213.         script.Parent.Parent.NalFolder.MonthNal.Text = NovemberTEXT
  214.     end
  215.  
  216.     if MonthRandomizer == 12 then
  217.         script.Parent.Parent.NalFolder.MonthNal.Text = DecemberTEXT
  218.     end
  219. end
  220.  
  221. script.Parent.MouseButton1Up:Connect(onClicked)
  222. end))
  223. TextLabel5.Name = "Month"
  224. TextLabel5.Parent = Frame2
  225. TextLabel5.Position = UDim2.new(0, 150, 0.245019913, 0)
  226. TextLabel5.Size = UDim2.new(0, 150, 0, 75)
  227. TextLabel5.BackgroundColor = BrickColor.new("Institutional white")
  228. TextLabel5.BackgroundColor3 = Color3.new(1, 1, 1)
  229. TextLabel5.BorderColor = BrickColor.new("Institutional white")
  230. TextLabel5.BorderColor3 = Color3.new(1, 1, 1)
  231. TextLabel5.Font = Enum.Font.SourceSansLight
  232. TextLabel5.FontSize = Enum.FontSize.Size14
  233. TextLabel5.Text = "7"
  234. TextLabel5.TextColor = BrickColor.new("Really black")
  235. TextLabel5.TextColor3 = Color3.new(0, 0, 0)
  236. TextLabel5.TextScaled = true
  237. TextLabel5.TextSize = 14
  238. TextLabel5.TextWrap = true
  239. TextLabel5.TextWrapped = true
  240. TextLabel6.Name = "Year"
  241. TextLabel6.Parent = Frame2
  242. TextLabel6.Position = UDim2.new(0.649999976, 0, 0.245019898, 0)
  243. TextLabel6.Size = UDim2.new(0, 164, 0, 75)
  244. TextLabel6.BackgroundColor = BrickColor.new("Institutional white")
  245. TextLabel6.BackgroundColor3 = Color3.new(1, 1, 1)
  246. TextLabel6.BorderColor = BrickColor.new("Institutional white")
  247. TextLabel6.BorderColor3 = Color3.new(1, 1, 1)
  248. TextLabel6.Font = Enum.Font.SourceSansLight
  249. TextLabel6.FontSize = Enum.FontSize.Size14
  250. TextLabel6.Text = "1866"
  251. TextLabel6.TextColor = BrickColor.new("Really black")
  252. TextLabel6.TextColor3 = Color3.new(0, 0, 0)
  253. TextLabel6.TextScaled = true
  254. TextLabel6.TextSize = 14
  255. TextLabel6.TextWrap = true
  256. TextLabel6.TextWrapped = true
  257. TextLabel7.Name = "Slash2"
  258. TextLabel7.Parent = Frame2
  259. TextLabel7.Position = UDim2.new(0.584999979, 0, 0.245019928, 0)
  260. TextLabel7.Size = UDim2.new(0, 32, 0, 75)
  261. TextLabel7.BackgroundColor = BrickColor.new("Institutional white")
  262. TextLabel7.BackgroundColor3 = Color3.new(1, 1, 1)
  263. TextLabel7.BorderColor = BrickColor.new("Institutional white")
  264. TextLabel7.BorderColor3 = Color3.new(1, 1, 1)
  265. TextLabel7.Font = Enum.Font.SourceSansLight
  266. TextLabel7.FontSize = Enum.FontSize.Size14
  267. TextLabel7.Text = "/"
  268. TextLabel7.TextColor = BrickColor.new("Really black")
  269. TextLabel7.TextColor3 = Color3.new(0, 0, 0)
  270. TextLabel7.TextScaled = true
  271. TextLabel7.TextSize = 14
  272. TextLabel7.TextWrap = true
  273. TextLabel7.TextWrapped = true
  274. TextLabel8.Name = "Slash"
  275. TextLabel8.Parent = Frame2
  276. TextLabel8.Position = UDim2.new(0.386000007, 0, 0.245019928, 0)
  277. TextLabel8.Size = UDim2.new(0, 32, 0, 75)
  278. TextLabel8.BackgroundColor = BrickColor.new("Institutional white")
  279. TextLabel8.BackgroundColor3 = Color3.new(1, 1, 1)
  280. TextLabel8.BorderColor = BrickColor.new("Institutional white")
  281. TextLabel8.BorderColor3 = Color3.new(1, 1, 1)
  282. TextLabel8.Font = Enum.Font.SourceSansLight
  283. TextLabel8.FontSize = Enum.FontSize.Size14
  284. TextLabel8.Text = "/"
  285. TextLabel8.TextColor = BrickColor.new("Really black")
  286. TextLabel8.TextColor3 = Color3.new(0, 0, 0)
  287. TextLabel8.TextScaled = true
  288. TextLabel8.TextSize = 14
  289. TextLabel8.TextWrap = true
  290. TextLabel8.TextWrapped = true
  291. TextLabel9.Name = "FrameLabel"
  292. TextLabel9.Parent = Frame2
  293. TextLabel9.Size = UDim2.new(0, 900, 0, 100)
  294. TextLabel9.BackgroundColor = BrickColor.new("Institutional white")
  295. TextLabel9.BackgroundColor3 = Color3.new(1, 1, 1)
  296. TextLabel9.BorderColor = BrickColor.new("Institutional white")
  297. TextLabel9.BorderColor3 = Color3.new(1, 1, 1)
  298. TextLabel9.Font = Enum.Font.SourceSansLight
  299. TextLabel9.FontSize = Enum.FontSize.Size48
  300. TextLabel9.Text = "Random Date Generator"
  301. TextLabel9.TextColor = BrickColor.new("Really black")
  302. TextLabel9.TextColor3 = Color3.new(0, 0, 0)
  303. TextLabel9.TextScaled = true
  304. TextLabel9.TextSize = 38
  305. TextLabel9.TextWrap = true
  306. TextLabel9.TextWrapped = true
  307. Folder10.Name = "NalFolder"
  308. Folder10.Parent = Frame2
  309. TextLabel11.Name = "YearNAL"
  310. TextLabel11.Parent = Folder10
  311. TextLabel11.Position = UDim2.new(0, 550, 0.430000007, 0)
  312. TextLabel11.Size = UDim2.new(0, 150, 0, 75)
  313. TextLabel11.BackgroundColor = BrickColor.new("Institutional white")
  314. TextLabel11.BackgroundColor3 = Color3.new(1, 1, 1)
  315. TextLabel11.BorderColor = BrickColor.new("Institutional white")
  316. TextLabel11.BorderColor3 = Color3.new(1, 1, 1)
  317. TextLabel11.Font = Enum.Font.SourceSansLight
  318. TextLabel11.FontSize = Enum.FontSize.Size14
  319. TextLabel11.Text = "1866"
  320. TextLabel11.TextColor = BrickColor.new("Really black")
  321. TextLabel11.TextColor3 = Color3.new(0, 0, 0)
  322. TextLabel11.TextScaled = true
  323. TextLabel11.TextSize = 14
  324. TextLabel11.TextWrap = true
  325. TextLabel11.TextWrapped = true
  326. TextLabel12.Name = "MonthNal"
  327. TextLabel12.Parent = Folder10
  328. TextLabel12.Position = UDim2.new(0.220994473, 0, 0.430278897, 0)
  329. TextLabel12.Size = UDim2.new(0, 150, 0, 75)
  330. TextLabel12.BackgroundColor = BrickColor.new("Institutional white")
  331. TextLabel12.BackgroundColor3 = Color3.new(1, 1, 1)
  332. TextLabel12.BorderColor = BrickColor.new("Institutional white")
  333. TextLabel12.BorderColor3 = Color3.new(1, 1, 1)
  334. TextLabel12.Font = Enum.Font.SourceSansLight
  335. TextLabel12.FontSize = Enum.FontSize.Size14
  336. TextLabel12.Text = "Jul"
  337. TextLabel12.TextColor = BrickColor.new("Really black")
  338. TextLabel12.TextColor3 = Color3.new(0, 0, 0)
  339. TextLabel12.TextScaled = true
  340. TextLabel12.TextSize = 14
  341. TextLabel12.TextWrap = true
  342. TextLabel12.TextWrapped = true
  343. TextLabel13.Name = "DayNAL"
  344. TextLabel13.Parent = Folder10
  345. TextLabel13.Position = UDim2.new(0.43784532, 0, 0.430278897, 0)
  346. TextLabel13.Size = UDim2.new(0, 90, 0, 75)
  347. TextLabel13.BackgroundColor = BrickColor.new("Institutional white")
  348. TextLabel13.BackgroundColor3 = Color3.new(1, 1, 1)
  349. TextLabel13.BorderColor = BrickColor.new("Institutional white")
  350. TextLabel13.BorderColor3 = Color3.new(1, 1, 1)
  351. TextLabel13.Font = Enum.Font.SourceSansLight
  352. TextLabel13.FontSize = Enum.FontSize.Size14
  353. TextLabel13.Text = "17"
  354. TextLabel13.TextColor = BrickColor.new("Really black")
  355. TextLabel13.TextColor3 = Color3.new(0, 0, 0)
  356. TextLabel13.TextScaled = true
  357. TextLabel13.TextSize = 14
  358. TextLabel13.TextWrap = true
  359. TextLabel13.TextWrapped = true
  360. TextLabel14.Name = "Comma"
  361. TextLabel14.Parent = Folder10
  362. TextLabel14.Position = UDim2.new(0.555248618, 0, 0.430278867, 0)
  363. TextLabel14.Size = UDim2.new(0, 16, 0, 75)
  364. TextLabel14.BackgroundColor = BrickColor.new("Institutional white")
  365. TextLabel14.BackgroundColor3 = Color3.new(1, 1, 1)
  366. TextLabel14.BorderColor = BrickColor.new("Institutional white")
  367. TextLabel14.BorderColor3 = Color3.new(1, 1, 1)
  368. TextLabel14.Font = Enum.Font.SourceSansLight
  369. TextLabel14.FontSize = Enum.FontSize.Size14
  370. TextLabel14.Text = ","
  371. TextLabel14.TextColor = BrickColor.new("Really black")
  372. TextLabel14.TextColor3 = Color3.new(0, 0, 0)
  373. TextLabel14.TextScaled = true
  374. TextLabel14.TextSize = 14
  375. TextLabel14.TextWrap = true
  376. TextLabel14.TextWrapped = true
  377. TextLabel15.Name = "Day"
  378. TextLabel15.Parent = Frame2
  379. TextLabel15.Position = UDim2.new(0.449999988, 0, 0.247011945, 0)
  380. TextLabel15.Size = UDim2.new(0, 90, 0, 75)
  381. TextLabel15.BackgroundColor = BrickColor.new("Institutional white")
  382. TextLabel15.BackgroundColor3 = Color3.new(1, 1, 1)
  383. TextLabel15.BorderColor = BrickColor.new("Institutional white")
  384. TextLabel15.BorderColor3 = Color3.new(1, 1, 1)
  385. TextLabel15.Font = Enum.Font.SourceSansLight
  386. TextLabel15.FontSize = Enum.FontSize.Size14
  387. TextLabel15.Text = "17"
  388. TextLabel15.TextColor = BrickColor.new("Really black")
  389. TextLabel15.TextColor3 = Color3.new(0, 0, 0)
  390. TextLabel15.TextScaled = true
  391. TextLabel15.TextSize = 14
  392. TextLabel15.TextWrap = true
  393. TextLabel15.TextWrapped = true
  394. Script16.Name = "Undragify"
  395. Script16.Parent = Frame2
  396. table.insert(cors,sandbox(Script16,function()
  397. local frame = script.Parent
  398.  
  399. frame.Selectable = false
  400. frame.Active = false
  401. frame.Draggable = false
  402.  
  403.  
  404. if frame.Draggable == false and frame.Active == false and frame.Selectable == false then
  405.     print("Yes")
  406. else
  407.     print("No")
  408. end
  409. end))
  410. TextLabel17.Name = "Credits"
  411. TextLabel17.Parent = Frame2
  412. TextLabel17.Position = UDim2.new(0, 650, 0, 550)
  413. TextLabel17.Size = UDim2.new(0, 250, 0, 50)
  414. TextLabel17.BackgroundColor = BrickColor.new("Institutional white")
  415. TextLabel17.BackgroundColor3 = Color3.new(1, 1, 1)
  416. TextLabel17.BorderColor = BrickColor.new("Institutional white")
  417. TextLabel17.BorderColor3 = Color3.new(1, 1, 1)
  418. TextLabel17.Font = Enum.Font.SourceSansLight
  419. TextLabel17.FontSize = Enum.FontSize.Size48
  420. TextLabel17.Text = "Credits to: Kaiji#7888"
  421. TextLabel17.TextColor = BrickColor.new("Dark grey")
  422. TextLabel17.TextColor3 = Color3.new(0.407843, 0.411765, 0.411765)
  423. TextLabel17.TextScaled = true
  424. TextLabel17.TextSize = 38
  425. TextLabel17.TextWrap = true
  426. TextLabel17.TextWrapped = true
  427.  
  428. -- Set the FontStyle property to Italic
  429. TextLabel17.FontFace.Style = Enum.FontStyle.Italic
  430. for i,v in pairs(mas:GetChildren()) do
  431.     v.Parent = script
  432.     pcall(function() v:MakeJoints() end)
  433. end
  434. mas:Destroy()
  435. for i,v in pairs(cors) do
  436.     spawn(function()
  437.         pcall(v)
  438.     end)
  439. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement