Advertisement
HenloMyDude

chat thing

Jan 11th, 2020
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.74 KB | None | 0 0
  1. wait()
  2. script.Parent = workspace
  3. Camera=workspace.CurrentCamera
  4. Player=owner
  5. Create=LoadLibrary'RbxUtility'.Create
  6. Core={
  7. SystemCall='>',
  8. Color=BrickColor.new('Really black');
  9. OutlineColor=BrickColor.new('Institutional white');
  10. TextColor=BrickColor.new('Institutional white');
  11. };
  12. local s = {
  13. Players = game:getService('Players'),
  14. Workspace = game:getService('Workspace'),
  15. RunService = game:getService('RunService');
  16. }
  17.  
  18. local chats = {}
  19. local NextRainbowColor = Color3.new()
  20. local function HSLtoRGB(hue, sat, light)
  21. local c = light > .5 and (2 - 2 * light) * sat or (2 * light) * sat
  22. local h2 = hue / 60
  23. local x = c * (1 - math.abs((h2 % 2) - 1))
  24. local rgbvals = {{c, x, 0}, {x, c, 0}, {0, c, x}, {0, x, c}, {x, 0, c}, {c, 0, x}}
  25. local rgb = rgbvals[math.floor(h2) + 1]
  26. for i = 1, 3 do rgb[i] = rgb[i] + (light - .5 * c) end
  27. return Color3.new(rgb[1], rgb[2], rgb[3])
  28. end
  29.  
  30. spawn(function()
  31. while wait() do
  32. for i = 0,350,5 do -- Heres how fast it changes colours
  33. pcall(function() NextRainbowColor = HSLtoRGB(i,1,0.5) end)
  34. s.RunService.Stepped:wait()
  35. end
  36. end
  37. end)
  38.  
  39. local Dark =Color3.new("Really black")
  40.  
  41. local Purple =Color3.new("Royal purple")
  42.  
  43.  
  44. function color(r,g,b)
  45. return Color3.new(r/255,g/255,b/255)
  46. end
  47. Player.CharacterAdded:connect(function()
  48. for i,v in next,chats do
  49. v.Removed = true
  50. end
  51. end)
  52. function Chat(msg,dark)
  53. if #msg > 200 or msg:match("^/e ") or msg:match("^/emote") or msg:match("^create/") or msg:match("^edit/") or msg:match("^exit/") or msg:match("^run") or msg:match("^g/") or msg:match("^c/") or msg:match("^h/") or msg:match("^hl/") or msg:match("^get/") then return end
  54. coroutine.wrap(function()
  55. delay(0,function()
  56. local isDark = dark or false
  57. local y = -40
  58. for i = #chats,1,-1 do
  59. local v = chats[i]
  60. if v.Removed == false then
  61. y = y - 40
  62. v.Message:TweenPosition(UDim2.new(.5,v.Message.Position.X.Offset,1,y),"In","Linear",0.5,true,function()
  63. if v.Message.Position.Y.Offset <= -40*4 then
  64. v.Remove = true
  65. end
  66. end)
  67. end
  68. end
  69.  
  70. local bg = Instance.new('BillboardGui',Create'Part'{Anchored=true,Transparency=1,CanCollide=false,Parent=Instance.new('Script', workspace),CFrame=workspace.CurrentCamera.CoordinateFrame})
  71. bg.Name = 'Chat'
  72. bg.StudsOffset = Vector3.new(0,7,0)
  73. bg.Adornee = bg.Parent
  74. bg.Size = UDim2.new(75,0,11,0)
  75. bg.AlwaysOnTop = true
  76. game:service'RunService'.Stepped:connect(function()
  77. if bg.Parent~=nil then
  78. if Player.Character~=nil then
  79. bg.Parent.CFrame=Player.Character.Head.CFrame
  80. end
  81. end
  82. end)
  83. local mesg = ""
  84. for i = 1, #msg do
  85. mesg = mesg .. msg:sub(i,i) .. "\1"
  86. end
  87.  
  88. local tl = Instance.new('TextBox',bg)
  89. tl.Text = mesg
  90. tl.Name = "Message"
  91. tl.BorderSizePixel = 0
  92. tl.ClipsDescendants = true
  93. tl.BackgroundTransparency = 0
  94. tl.TextTransparency = 1
  95. if isDark then
  96. tl.TextColor = BrickColor.new('Magenta')
  97. else
  98. tl.TextColor = BrickColor.new('White')
  99. end
  100. tl.FontSize = 5
  101. tl.Font =("SourceSansBold")
  102. tl.Size = UDim2.new(0,tl.TextBounds.X+25,0,0)
  103. tl.Position = UDim2.new(.5,(-tl.TextBounds.X-25)/2,1,0)
  104.  
  105. tl:TweenSizeAndPosition(UDim2.new(0,tl.TextBounds.X+25,0,40),UDim2.new(.5,(-tl.TextBounds.X-25)/2,1,-40),"In","Linear",0.5,true)
  106.  
  107. local spot = #chats+1
  108.  
  109. chats[spot] = {Message = tl,Removed = false,Remove = false}
  110.  
  111. local r,g,b = math.random(1,255),math.random(1,255),math.random(1,255)
  112. local rr,gr,br = false,false,false
  113. local removed = false
  114.  
  115. delay(0,function()
  116. for i = 1,.5,-.05 do
  117. wait(0.05)
  118. tl.BackgroundTransparency = i
  119. end
  120. end)
  121. delay(0,function()
  122. for i = 1,0,-.1 do
  123. wait(0.05)
  124. tl.TextTransparency = i
  125. end
  126. end)
  127.  
  128. delay(0,function()
  129. while removed == false do
  130. wait(0.05)
  131. if r >= 250 then
  132. rr = true
  133. end
  134. if g >= 250 then
  135. gr = true
  136. end
  137. if b >= 250 then
  138. br = true
  139. end
  140. if b <= 5 then
  141. br = false
  142. end
  143. if g <= 5 then
  144. gr = false
  145. end
  146. if r <= 5 then
  147. rr = false
  148. end
  149. if rr == true then
  150. r = r - 5
  151. else
  152. r = r + 5
  153. end
  154. if gr == true then
  155. g = g - 5
  156. else
  157. g = g + 5
  158. end
  159. if br == true then
  160. b = b - 5
  161. else
  162. b = b + 5
  163. end
  164. pcall(function() if not isDark then tl.BackgroundColor3 = NextRainbowColor else tl.BackgroundColor = BrickColor.new("Really black") end end)
  165. end
  166. end)
  167.  
  168.  
  169. local remove = false
  170.  
  171. delay(0,function()
  172. wait(3)
  173. remove = true
  174. end)
  175.  
  176. delay(0,function()
  177. while remove == false do
  178. wait()
  179. if chats[spot].Remove == true then
  180. remove = true
  181. end
  182. end
  183. end)
  184.  
  185. delay(0,function()
  186. repeat wait() until remove == true
  187. delay(0,function()
  188. for i = .5,1,.05 do
  189. wait(0.05)
  190. tl.BackgroundTransparency = i
  191. end
  192. end)
  193. delay(0,function()
  194. for i = 0,1,.1 do
  195. wait(0.05)
  196. tl.TextTransparency = i
  197. end
  198. bg:remove()
  199. removed = true
  200. chats[spot].Removed = true
  201. end)
  202. end)
  203. end)
  204. end)()
  205. end
  206. Player.Chatted:connect(function(msg)
  207. Chat(msg)
  208. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement