Advertisement
NightGamingVN

public script 8 - discord compact ping

Jun 16th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.35 KB | None | 0 0
  1. -- made by pdnghiaqoi [marseio]
  2. -- beside the GetDate() function, i made everything
  3. function GetDate()
  4. local date = {}
  5. local months = {
  6. {"January", 31};
  7. {"February", 28};
  8. {"March", 31};
  9. {"April", 30};
  10. {"May", 31};
  11. {"June", 30};
  12. {"July", 31};
  13. {"August", 31};
  14. {"September", 30};
  15. {"October", 31};
  16. {"November", 30};
  17. {"December", 31};
  18. }
  19. local t = tick()
  20. date.total = t
  21. date.seconds = math.floor(t % 60)
  22. date.minutes = math.floor((t / 60) % 60)
  23. date.hours = math.floor((t / 60 / 60) % 24)
  24. date.year = (1970 + math.floor(t / 60 / 60 / 24 / 365.25))
  25. date.yearShort = tostring(date.year):sub(-2)
  26. date.isLeapYear = ((date.year % 4) == 0)
  27. date.isAm = (date.hours < 12)
  28. date.hoursPm = (date.isAm and date.hours or (date.hours == 12 and 12 or (date.hours - 12)))
  29. if (date.hoursPm == 0) then date.hoursPm = 12 end
  30. if (date.isLeapYear) then
  31. months[2][2] = 29
  32. end
  33. do
  34. date.dayOfYear = math.floor((t / 60 / 60 / 24) % 365.25)
  35. local dayCount = 0
  36. for i,month in pairs(months) do
  37. dayCount = (dayCount + month[2])
  38. if (dayCount > date.dayOfYear) then
  39. date.monthWord = month[1]
  40. date.month = i
  41. date.day = (date.dayOfYear - (dayCount - month[2]) + 1)
  42. break
  43. end
  44. end
  45. end
  46. function date:format(str)
  47. str = str
  48. :gsub("#s", ("%.2i"):format(self.seconds))
  49. :gsub("#m", ("%.2i"):format(self.minutes))
  50. :gsub("#h", tostring(self.hours))
  51. :gsub("#H", tostring(self.hoursPm))
  52. :gsub("#Y", tostring(self.year))
  53. :gsub("#y", tostring(self.yearShort))
  54. :gsub("#a", (self.isAm and "AM" or "PM"))
  55. :gsub("#W", self.monthWord)
  56. :gsub("#M", tostring(self.month))
  57. :gsub("#d", tostring(self.day))
  58. :gsub("#D", tostring(self.dayOfYear))
  59. :gsub("#t", tostring(self.total))
  60. return str
  61. end
  62. return date
  63. end
  64. local date = GetDate()
  65. ScreenGui0 = Instance.new("ScreenGui")
  66. ScreenGui0.Enabled = false
  67. ScreenGui0.DisplayOrder = 100
  68. Sound0 = Instance.new("Sound")
  69. Sound0.Parent = ScreenGui0
  70. Sound0.SoundId = "rbxassetid://570433034"
  71. Sound0.Volume = 2
  72. Frame1 = Instance.new("Frame")
  73. TextLabel2 = Instance.new("TextLabel")
  74. TextLabel3 = Instance.new("TextLabel")
  75. TextLabel4 = Instance.new("TextLabel")
  76. ScreenGui0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  77. Frame1.Parent = ScreenGui0
  78. Frame1.Size = UDim2.new(1, 0, 0, 25)
  79. Frame1.BackgroundColor = BrickColor.new("Earth green")
  80. Frame1.BackgroundColor3 = Color3.new(0.211765, 0.223529, 0.243137)
  81. Frame1.BorderSizePixel = 0
  82. TextLabel2.Name = "Time"
  83. TextLabel2.Parent = Frame1
  84. TextLabel2.Size = UDim2.new(0, 50, 1, 0)
  85. TextLabel2.BackgroundColor = BrickColor.new("Institutional white")
  86. TextLabel2.BackgroundColor3 = Color3.new(1, 1, 1)
  87. TextLabel2.BackgroundTransparency = 1
  88. TextLabel2.Font = Enum.Font.SourceSans
  89. TextLabel2.FontSize = Enum.FontSize.Size14
  90. TextLabel2.Text = "??:??"
  91. TextLabel2.TextColor = BrickColor.new("Dark grey metallic")
  92. TextLabel2.TextColor3 = Color3.new(0.27451, 0.313726, 0.313726)
  93. TextLabel2.TextSize = 14
  94. TextLabel3.Name = "Name"
  95. TextLabel3.Parent = Frame1
  96. TextLabel3.Position = UDim2.new(0, 50, 0, 0)
  97. TextLabel3.Size = UDim2.new(0, 10, 1, 0)
  98. TextLabel3.BackgroundColor = BrickColor.new("Institutional white")
  99. TextLabel3.BackgroundColor3 = Color3.new(1, 1, 1)
  100. TextLabel3.BackgroundTransparency = 1
  101. TextLabel3.Font = Enum.Font.Highway
  102. TextLabel3.FontSize = Enum.FontSize.Size18
  103. TextLabel3.Text = "ABCDFASDDSADSADSA"
  104. TextLabel3.TextColor = BrickColor.new("Institutional white")
  105. TextLabel3.TextColor3 = Color3.new(1, 1, 1)
  106. TextLabel3.TextSize = 17
  107. TextLabel3.TextWrap = true
  108. TextLabel3.TextWrapped = true
  109. TextLabel3.TextXAlignment = Enum.TextXAlignment.Left
  110. TextLabel4.Name = "Msg"
  111. TextLabel4.Parent = Frame1
  112. TextLabel4.Position = UDim2.new(0, 75, 0, 0)
  113. TextLabel4.Size = UDim2.new(1, 0, 1, 0)
  114. TextLabel4.BackgroundColor = BrickColor.new("Institutional white")
  115. TextLabel4.BackgroundColor3 = Color3.new(1, 1, 1)
  116. TextLabel4.BackgroundTransparency = 1
  117. TextLabel4.Font = Enum.Font.Highway
  118. TextLabel4.FontSize = Enum.FontSize.Size18
  119. TextLabel4.Text = "if you see this then the script may have overloaded"
  120. TextLabel4.TextColor = BrickColor.new("Ghost grey")
  121. TextLabel4.TextColor3 = Color3.new(0.796079, 0.815686, 0.839216)
  122. TextLabel4.TextSize = 15
  123. TextLabel4.TextWrap = true
  124. TextLabel4.TextWrapped = true
  125. TextLabel4.TextXAlignment = Enum.TextXAlignment.Left
  126. function chat(target,plr,msg)
  127. spawn(function()
  128. local textsize = 0
  129. local position = 70
  130. local h = tonumber(date:format("#h"))
  131. local m = tonumber(date:format("#m"))
  132. if h < 10 then
  133. h = tonumber("0"..h)
  134. end
  135. if m < 10 then
  136. m = tonumber("0"..m)
  137. end
  138. local name = plr.Name
  139. for i = 1,#name do
  140. textsize = textsize+10
  141. position = position+7
  142. end
  143. local gui = ScreenGui0:Clone()
  144. local frame = gui:WaitForChild("Frame")
  145. local tim = frame:WaitForChild("Time")
  146. local mes = frame:WaitForChild("Msg")
  147. local name = frame:WaitForChild("Name")
  148. tim.Text = h..":"..m
  149. name.Size = UDim2.new(0, textsize, 1, 0)
  150. mes.Position = UDim2.new(0, position, 0, 0)
  151. name.Text = plr.Name
  152. mes.Text = msg
  153. gui.Parent = target.PlayerGui
  154. gui.Enabled = true
  155. gui:WaitForChild("Sound"):Play()
  156. wait(3)
  157. gui:Remove()
  158. end)
  159. end
  160. function random()
  161. local plrs = {}
  162. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  163. table.insert(plrs,v)
  164. end
  165. return plrs[math.random(1,#plrs)]
  166. end
  167. function find(name)
  168. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  169. if string.sub(v.Name, 1, #name) == name then
  170. return v
  171. end
  172. end
  173. return nil
  174. end
  175.  
  176. function returnargument(message)
  177. local Split = message:find("@")
  178. if not Split then return nil end
  179. local ATS = message:sub(Split)
  180. local BTS = ATS:find(" ")
  181. if BTS then
  182. local CTS = ATS:sub(1,BTS-1)
  183. return CTS
  184. end
  185. return ATS
  186. end
  187.  
  188. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  189. spawn(function()
  190. v.Chatted:Connect(function(mes)
  191. if not string.sub(mes, 1, 1) == "@" then return end
  192. local ping = returnargument(mes)
  193. if not ping then return end
  194. if ping == "@everyone" or ping == "@here" then
  195. for i,p in pairs(game:GetService("Players"):GetPlayers()) do
  196. chat(p, v, mes)
  197. end
  198. elseif ping == "@someone" then
  199. local rd = random()
  200. chat(rd, v, mes)
  201. end
  202. local player = find(string.sub(ping, 2))
  203. if not player then return end
  204. chat(player, v, mes)
  205. end)
  206. end)
  207. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement