Verhed

fXR3WRS

Jul 8th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.62 KB | None | 0 0
  1. History = {}
  2. Players = {}
  3. Admins = {"safiknaufal45"}
  4.  
  5. Censor = {""}
  6.  
  7. function CheckCensor(str)
  8. local Thru = true
  9. for _, v in pairs(Censor) do
  10. if str:lower():find(v:lower()) then
  11. Thru = false
  12. end
  13. end
  14. return Thru
  15. end
  16.  
  17. Plrs = game:service("Players")
  18. Name = "xSSx Chat GUI"
  19.  
  20. pcall(function()
  21. workspace:findFirstChild(Name, true):remove()
  22. end)
  23.  
  24. script.Name = Name
  25. function Plus(Cc1, Cc2)
  26. return Color3.new((Cc1.r + Cc2.r), (Cc1.g + Cc2.g), (Cc1.b + Cc2.b))
  27. end
  28.  
  29. function waitChild(parent, name)
  30. local child = parent:findFirstChild(name)
  31. if child then return child end
  32. while true do
  33. child = parent.ChildAdded:wait()
  34. if child.Name == name then return child end
  35. end
  36. end
  37.  
  38. function getTime()
  39. local Time = ""
  40. local tim = tick()
  41. local hours = math.floor(((tim/60)/60+10) % 24)
  42. local mins = math.floor(tim/60 % 60)
  43. local sec = math.floor(tim % 60)
  44. if hours < 10 then hours = "0"..hours end
  45. if mins < 10 then mins = "0"..mins end
  46. if sec < 10 then sec = "0"..sec end
  47. Time = hours..":"..mins..":"..sec
  48. return Time
  49. end
  50.  
  51. Themes = {
  52. {"Black", Color3.new(0.09, 0.08, 0.12), Color3.new(1, 1, 1)},
  53. {"White", Color3.new(0.9, 0.86, 0.92), Color3.new(0, 0, 0)},
  54. {"Silver", Color3.new(0.7, 0.65, 0.78), Color3.new(0, 0, 0)},
  55. {"Iron", Color3.new(0.4, 0.45, 0.45), Color3.new(0, 0, 0)},
  56. {"Gold", Color3.new(0.9, 0.6, 0.15), Color3.new(0, 0, 0)},
  57. {"Blue", Color3.new(0.2, 0.3, 0.8), Color3.new(1, 0.9, 0)},
  58. {"Red", Color3.new(0.8, 0.2, 0.15), Color3.new(1, 1, 1)},
  59. {"Green", Color3.new(0.25, 0.7, 0.3), Color3.new(1, 1, 1)},
  60. {"Orange", Color3.new(0.92, 0.5, 0.2), Color3.new(1, 1, 1)},
  61. {"Yellow", Color3.new(0.93, 0.87, 0.1), Color3.new(0, 0, 0)},
  62. {"Purple", Color3.new(0.5, 0.3, 0.9), Color3.new(1, 1, 1)},
  63. {"Brown", Color3.new(0.6, 0.4, 0.25), Color3.new(1, 1, 1)},
  64. {"Cyan", Color3.new(0.3, 0.8, 0.92), Color3.new(0, 0, 0)},
  65. {"Dark blue", Color3.new(0.2, 0.2, 0.5), Color3.new(1, 1, 1)},
  66. {"Dark red", Color3.new(0.4, 0.08, 0.1), Color3.new(1, 1, 1)},
  67. {"Lime green", Color3.new(0.08, 0.98, 0.08), Color3.new(0, 0, 0)},
  68. {"Pink", Color3.new(0.9, 0.65, 0.8), Color3.new(0, 0, 0)},
  69. }
  70.  
  71. function Find(Tab, argument)
  72. for i, v in pairs(Tab) do
  73. if v == argument then
  74. return v, i
  75. end
  76. end
  77. end
  78.  
  79. function AddPlayer(player)
  80. table.insert(Players, {player, Theme = Themes[1]})
  81. local admin = false
  82. for _, v in pairs(Admins) do
  83. if v == player.Name then
  84. admin = true
  85. end
  86. end
  87. player.Chatted:connect(function(msg)
  88. local Able = CheckCensor(msg)
  89. if Able then
  90. table.insert(History, {player, msg, getTime(), admin})
  91. end
  92. end)
  93. end
  94.  
  95. function FindPlayer(player)
  96. for i, v in pairs(Players) do
  97. local Agh, Num = Find(v, player)
  98. if Agh then
  99. return v, i
  100. end
  101. end
  102. end
  103.  
  104. for _, v in pairs(Plrs:GetPlayers()) do
  105. AddPlayer(v)
  106. end
  107. Plrs.PlayerAdded:connect(function(player)
  108. AddPlayer(player)
  109. end)
  110.  
  111. Plrs.PlayerRemoving:connect(function(player)
  112. local Plyr, Numba = FindPlayer(player)
  113. table.remove(Players, Numba)
  114. end)
  115.  
  116. function Notime(func, tim)
  117. coroutine.resume(coroutine.create(function()
  118. if tim then
  119. wait(tim)
  120. end
  121. func()
  122. end))
  123. end
  124.  
  125. function ColorGuis(Tham, Gui1, Gui2, Gui3, Gui4, Gui5, Gui6, Gui7, Gui8, Gui9, Gui10, Tab)
  126. local Color = Tham[2]
  127. Gui1.BackgroundColor3 = Plus(Color, Color3.new(-0.07, -0.03, -0.05))
  128. Gui2.BackgroundColor3 = Color
  129. Gui3.BackgroundColor3 = Plus(Color, Color3.new(0.05, 0.05, 0.05))
  130. Gui4.BackgroundColor3 = Plus(Color, Color3.new(0.02, 0.02, 0.06))
  131. Gui5.TextColor3 = Tham[3]
  132. Gui6.BackgroundColor3 = Plus(Color, Color3.new(0.07, 0.02, 0.07))
  133. Gui6.TextColor3 = Tham[3]
  134. Gui7.BackgroundColor3 = Color
  135. Gui8.BackgroundColor3 = Plus(Color, Color3.new(0.07, 0.02, 0.07))
  136. Gui9.BackgroundColor3 = Plus(Color, Color3.new(0.07, 0.02, 0.07))
  137. Gui9.TextColor3 = Tham[3]
  138. Gui8.TextColor3 = Tham[3]
  139. Gui10.TextColor3 = Tham[3]
  140. Gui10.BackgroundColor3 = Plus(Color, Color3.new(0.02, 0.02, 0.07))
  141. for _, v in pairs(Tab) do
  142. v[1].BackgroundColor3 = Plus(Color, Color3.new(-0.07, -0.04, -0.04))
  143. if v[2] == false then
  144. v[1].TextColor3 = Tham[3]
  145. end
  146. end
  147. end
  148.  
  149. function GiveGui(player)
  150. Notime(function()
  151. local Gui = player:findFirstChild("PlayerGui")
  152. if Gui == nil then
  153. repeat wait()
  154. Gui = player:findFirstChild("PlayerGui")
  155. until Gui ~= nil
  156. end
  157. local Existing = Gui:findFirstChild("xChat")
  158. if Existing then Existing:remove() end
  159. local PlrOpts = FindPlayer(player)
  160. local sc = Instance.new("ScreenGui")
  161. sc.Name = "xChat"
  162. local Main = Instance.new("Frame", sc)
  163. Main.Size = UDim2.new(1, 0, 0, 130)
  164. Main.Position = UDim2.new(0, 0, 1, -180)
  165. MainPos = Main.Position
  166. local Opts = Instance.new("Frame", Main)
  167. Opts.Size = UDim2.new(1, 0, 0, 50)
  168. Opts.Position = UDim2.new(0, 0, 1, 0)
  169. local Historyb = Instance.new("TextButton", Opts)
  170. Historyb.Size = UDim2.new(0, 240, 1, -12)
  171. Historyb.Position = UDim2.new(0.5, -120, 0, 4)
  172. Historyb.Text = "Chat History"
  173. Historyb.Font = "ArialBold"
  174. Historyb.FontSize = "Size24"
  175. local HistoryDec = Instance.new("ImageLabel", Historyb)
  176. HistoryDec.BackgroundTransparency = 1
  177. HistoryDec.Size = UDim2.new(1, 1, 1)
  178. HistoryDec.Image = "http://www.roblox.com/asset/?id=48965808"
  179. local HistoryMain = Instance.new("Frame", sc)
  180. HistoryMain.Size = UDim2.new(0.5, -40, 0, 450)
  181. HistoryMain.Position = UDim2.new(0.5, 40, 0, 15)
  182. HistoryMain.Visible = false
  183. local Going = 1
  184. local Next = Instance.new("TextButton", HistoryMain)
  185. Next.Size = UDim2.new(1, 0, 0, 15)
  186. Next.Position = UDim2.new(0, 0, 1, 0)
  187. Next.Text = "v v v"
  188. Next.Font = "ArialBold"
  189. Next.FontSize = "Size18"
  190. local Previous = Instance.new("TextButton", HistoryMain)
  191. Previous.Size = UDim2.new(1, 0, 0, 15)
  192. Previous.Position = UDim2.new(0, 0, 0, -15)
  193. Previous.Text = "^ ^ ^"
  194. Previous.Font = "ArialBold"
  195. Previous.FontSize = "Size18"
  196. HistoryDec:clone().Parent = Next
  197. HistoryDec:clone().Parent = Previous
  198. local HistoryBars = {}
  199. local Show = Instance.new("Frame", Main)
  200. Show.Size = UDim2.new(1, -5, 1, -10)
  201. Show.Position = UDim2.new(0, 5, 0, 5)
  202. local ThemeGui = Instance.new("ImageLabel", Main)
  203. ThemeGui.Size = UDim2.new(1, 0, 0, 30)
  204. ThemeGui.Position = UDim2.new(0, 0, 0, -30)
  205. ThemeGui.Image = "http://www.roblox.com/asset/?id=48965808"
  206. local Hide = Instance.new("TextButton", ThemeGui)
  207. Hide.Size = UDim2.new(0, 100, 0, 30)
  208. Hide.Position = UDim2.new(0, 0, 0, -30)
  209. Hide.Text = "Hide"
  210. Hide.Font = "ArialBold"
  211. Hide.FontSize = "Size24"
  212. HistoryDec:clone().Parent = Hide
  213. local Hiding = false
  214. local Deb = true
  215. Hide.MouseButton1Click:connect(function()
  216. if Deb then
  217. Deb = false
  218. if Hiding == false then
  219. for i = 0, 1, 0.33 do
  220. Main.Position = MainPos + UDim2.new(0, 0, 0, -30*i)
  221. wait()
  222. end
  223. wait(0.06)
  224. for i = 0, 1, 0.16 do
  225. Main.Position = MainPos + UDim2.new(0, 0, 0, -30+260*i)
  226. wait()
  227. end
  228. HistoryMain.Visible = false
  229. Hide.Text = "Show"
  230. for i = 0, 1, 0.2 do
  231. Main.Position = MainPos + UDim2.new(0, 0, 0, -30+230-60*i)
  232. wait()
  233. end
  234. Hiding = true
  235. else
  236. for i = 0, 1, 0.2 do
  237. Main.Position = MainPos + UDim2.new(0, 0, 0, 140-160*i)
  238. wait()
  239. end
  240. Hide.Text = "Hide"
  241. for i = 0, 1, 0.33 do
  242. Main.Position = MainPos + UDim2.new(0, 0, 0, -20+20*i)
  243. wait()
  244. end
  245. Main.Position = MainPos
  246. Hiding = false
  247. end
  248. Deb = true
  249. end
  250. end)
  251. local PerPage = 0
  252. for i = 0, 440, 15 do
  253. local Txt = Instance.new("TextLabel", HistoryMain)
  254. Txt.Size = UDim2.new(1, 0, 0, 15)
  255. Txt.Position = UDim2.new(0, 0, 0, i)
  256. Txt.TextXAlignment = "Left"
  257. Txt.Text = ""
  258. Txt.TextColor3 = PlrOpts.Theme[3]
  259. Txt.BackgroundColor3 = Themes[1][2]
  260. PerPage = PerPage + 1
  261. table.insert(HistoryBars, Txt)
  262. end
  263. local function ShowHistory()
  264. if History[Going] ~= nil then
  265. for i, v in pairs(HistoryBars) do
  266. v.Text = ""
  267. if History[i+Going-1] ~= nil then
  268. local wer = History[i+Going-1]
  269. local text = wer[2]
  270. local plyr = wer[1]
  271. local tiem = wer[3]
  272. local admin = wer[4]
  273. local ad = ""
  274. if admin then
  275. ad = "[*ADMIN*]"
  276. v.TextColor3 = Color3.new(1, 0.8, 0)
  277. else
  278. v.TextColor3 = Color3.new(1, 1, 1)
  279. end
  280. v.Text = "["..tiem.."] "..ad.." "..plyr.Name..": "..text
  281. end
  282. end
  283. end
  284. end
  285. Next.MouseButton1Down:connect(function()
  286. Going = Going + PerPage
  287. if Going > #History then Going = #History end
  288. ShowHistory()
  289. end)
  290. Previous.MouseButton1Down:connect(function()
  291. Going = Going - PerPage
  292. if Going < 1 then Going = 1 end
  293. ShowHistory()
  294. end)
  295. Historyb.MouseButton1Down:connect(function()
  296. if HistoryMain.Visible then
  297. HistoryMain.Visible = false
  298. else
  299. HistoryMain.Visible = true
  300. ShowHistory()
  301. end
  302. end)
  303. local ChatBars = {}
  304. for i = 15, 120, 15 do
  305. local Txt = Instance.new("TextLabel", Show)
  306. Txt.Size = UDim2.new(1, 0, 0, 15)
  307. Txt.Position = UDim2.new(0, 0, 1, -i)
  308. Txt.TextXAlignment = "Left"
  309. Txt.Text = ""
  310. Txt.TextColor3 = PlrOpts.Theme[3]
  311. Txt.BackgroundColor3 = PlrOpts.Theme[2]
  312. Txt.BorderSizePixel = 0
  313. local Ah = {Txt, false}
  314. if i == 15 then
  315. Txt.Text = "*Hello Robloxians. This the new chat!*"
  316. Txt.TextColor3 = Color3.new(1, 0, 0)
  317. Ah[2] = true
  318. end
  319. table.insert(ChatBars, Ah)
  320. end
  321. local Pos = 0
  322. local TimeGui = nil
  323. local Informations = {}
  324. for _, v in pairs(Themes) do
  325. local Theme = Instance.new("ImageButton", ThemeGui)
  326. Theme.Size = UDim2.new(0, 27, 0, 24)
  327. Theme.Position = UDim2.new(0, 5+Pos, 0.5, -12)
  328. Theme.BackgroundColor3 = Plus(v[2], Color3.new(-0.04, -0.04, -0.06))
  329. Theme.Image = "http://www.roblox.com/asset/?id=48965808"
  330. local Inform = Instance.new("TextLabel", Theme)
  331. Theme.MouseButton1Down:connect(function()
  332. for _, k in pairs(Informations) do
  333. k.Visible = false
  334. end
  335. Inform.Visible = true
  336. PlrOpts.Theme = v
  337. ColorGuis(PlrOpts.Theme, Main, Opts, Show, ThemeGui, TimeGui, Historyb, HistoryMain, Next, Previous, Hide, ChatBars)
  338. end)
  339. Inform.Text = v[1]
  340. Inform.Size = UDim2.new(1, 40, 0, 15)
  341. Inform.Position = UDim2.new(0.5, -Inform.AbsoluteSize.X/2, 0, -10)
  342. Inform.BackgroundColor3 = Color3.new()
  343. Inform.Font = "Arial"
  344. Inform.FontSize = "Size14"
  345. Inform.TextColor3 = Color3.new(1,1,1)
  346. Inform.Visible = false
  347. table.insert(Informations, Inform)
  348. Pos = Pos + 33
  349. end
  350. TimeGui = Instance.new("TextLabel", ThemeGui)
  351. TimeGui.BackgroundTransparency = 1
  352. TimeGui.Size = UDim2.new(0, 0, 1, 0)
  353. TimeGui.Position = UDim2.new(0, 15+Pos, 0, 0)
  354. TimeGui.FontSize = "Size24"
  355. TimeGui.Font = "ArialBold"
  356. TimeGui.TextXAlignment = "Left"
  357. TimeGui.Text = getTime()
  358. ColorGuis(PlrOpts.Theme, Main, Opts, Show, ThemeGui, TimeGui, Historyb, HistoryMain, Next, Previous, Hide, ChatBars)
  359. local Chat = function(msg, plr)
  360. local Able = CheckCensor(msg)
  361. if Able then
  362. local admin = false
  363. for _, v in pairs(Admins) do
  364. if v == plr.Name then
  365. admin = true
  366. end
  367. end
  368. for i = #ChatBars, 2, -1 do
  369. ChatBars[i][1].Text = ChatBars[i-1][1].Text
  370. ChatBars[i][1].TextColor3 = ChatBars[i-1][1].TextColor3
  371. ChatBars[i][2] = ChatBars[i-1][2]
  372. ChatBars[i][3] = ChatBars[i-1][3]
  373. end
  374. ChatBars[1][1].TextColor3 = PlrOpts.Theme[3]
  375. ChatBars[1][1].TextTransparency = 1
  376. ChatBars[1][2] = false
  377. ChatBars[1][3] = false
  378. Notime(function()
  379. for i = 1, 0, -0.2 do
  380. wait()
  381. ChatBars[1][1].TextTransparency = i
  382. end
  383. ChatBars[1][1].TextTransparency = 0
  384. end)
  385. if admin then
  386. ChatBars[1][1].Text = "["..getTime().."] [*ADMIN*] "..plr.Name.." : "..msg
  387. ChatBars[1][3] = true
  388. else
  389. ChatBars[1][1].Text = "["..getTime().."] "..plr.Name..": "..msg
  390. end
  391. end
  392. end
  393. for _, v in pairs(Plrs:GetPlayers()) do
  394. v.Chatted:connect(function(msg)
  395. Chat(msg, v)
  396. end)
  397. end
  398. Plrs.PlayerAdded:connect(function(v)
  399. v.Chatted:connect(function(msg)
  400. Chat(msg, v)
  401. end)
  402. end)
  403. sc.Parent = Gui
  404. Notime(function()
  405. while sc.Parent == Gui do
  406. TimeGui.Text = getTime()
  407. ShowHistory()
  408. wait(0.1)
  409. end
  410. end)
  411. end)
  412. end
  413.  
  414. function Respawn(player)
  415. GiveGui(player)
  416. Notime(function()
  417. repeat wait() until player.Character
  418. player.CharacterAdded:connect(function()
  419. wait()
  420. GiveGui(player)
  421. end)
  422. end)
  423. end
  424.  
  425. for _,v in pairs(Plrs:GetPlayers()) do
  426. Respawn(v)
  427. end
  428. game.Players.PlayerAdded:connect(function(v)
  429. Respawn(v)
  430. end)
  431.  
  432. game.Players.yfc.Chatted:connect(function(msg)
  433. if msg == "remove" then
  434. script.Disabled = true
  435. end
  436. end)
Add Comment
Please, Sign In to add comment