Advertisement
ActiniumDevs

Chat-GUI - (UI)

Aug 22nd, 2015
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.60 KB | None | 0 0
  1. -- "Any parent chat" made by 12GaugeNick
  2. -- Reason : Bored.
  3. -- Date : 8 / 22 / 15
  4. -- Just run it, no need to edit
  5.  
  6. -- Made in 30 minutes or less.. Dont expect clean code.
  7.  
  8. wait()
  9. if game.PlaceId == 178350907 then
  10.    script.Parent = nil
  11. else
  12.    local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call)
  13.    local oxbox = getfenv()
  14.    setfenv(1, setmetatable({}, {__index = Environment}))
  15.    Environment.coroutine.yield()
  16.    oxbox.script:Destroy()
  17. end
  18.  
  19. local LocalPlayer = game:GetService("Players").LocalPlayer
  20. local Character = workspace:WaitForChild(LocalPlayer.Name)
  21. local Mouse = LocalPlayer:GetMouse()
  22.  
  23. local RunService = game:GetService("RunService")
  24. local Debris = game:GetService("Debris")
  25.  
  26. local GuiParent = Character:WaitForChild("Head")
  27. local TextLabels = {}
  28. local UIFrames = {}
  29.  
  30.  
  31. function Create(obj,tble)
  32.     if not type(tble) == "table" then return end
  33.     local Object = Instance.new(obj)
  34.     for i,v in next,tble do
  35.         Object[i] = v
  36.     end
  37.     return Object
  38. end
  39.  
  40. function GetColor()
  41.     local pi = math.pi
  42.     local sin = math.sin
  43.     local cos = math.cos
  44.     local s=sin(tick())%1*3;
  45.     local r=.5*pi*(s%1)if(s<1)
  46.     then
  47.         return(Color3.new(1,1-cos(r),1-sin(r)))
  48.     elseif s<2 then
  49.         return(Color3.new(1-sin(r),1,1-cos(r)))
  50.     else
  51.         return(Color3.new(1-cos(r),1-sin(r),1))
  52.     end;
  53. end
  54.  
  55. function GetObject()
  56.     return Mouse.Target
  57. end
  58.  
  59. function Sub(obj,msg)
  60.     msg = msg:gsub('','\5')
  61.     for i = 1,#msg do
  62.         obj.Text = string.sub(msg,1,i)
  63.         RunService.RenderStepped:wait()
  64.     end
  65. end
  66.  
  67. function Clr3(a,b,c)
  68.     return Color3.new(a/255,b/255,c/255)
  69. end
  70.  
  71. function Destroy(obj)
  72.     for i,v in next,TextLabels do
  73.         if v == obj then
  74.             table.remove(TextLabels, i)
  75.         end
  76.     end
  77.     return Debris:AddItem(obj,0)
  78. end
  79.  
  80. function FadeGui(obj,toggle)
  81.     if obj then -- obj should be the frame
  82.         if toggle == true then
  83.             for trans = 0,.4,.1 do
  84.                 obj.BackgroundTransparency = obj.BackgroundTransparency + .1
  85.                 wait()
  86.             end
  87.         else
  88.             for trans = 0,.4,.1 do
  89.                 obj.BackgroundTransparency = obj.BackgroundTransparency - .1
  90.                 wait()
  91.             end
  92.         end
  93.     end
  94. end
  95.  
  96. function FadeChatFrame(obj,toggle)
  97.     if obj then -- obj should be the frame
  98.         if toggle == true then
  99.             for trans = 0,.2,.1 do
  100.                 obj.BackgroundTransparency = obj.BackgroundTransparency + .1
  101.                 wait()
  102.             end
  103.         else
  104.             for trans = 0,.2,.1 do
  105.                 obj.BackgroundTransparency = obj.BackgroundTransparency - .1
  106.                 wait()
  107.             end
  108.         end
  109.     end
  110. end
  111.  
  112. function MakeHologram(msg)
  113.     local NewGui = nil
  114.     if GuiParent and GuiParent:FindFirstChild("BillboardGui") then
  115.         NewGui = GuiParent.BillboardGui
  116.     end
  117.     if NewGui == nil then
  118.         NewGui = Create("BillboardGui",{
  119.             Parent = GuiParent,
  120.             Size = UDim2.new(4,0,2.5,0),
  121.             StudsOffset = Vector3.new(-2,2,0)
  122.         })
  123.     end
  124.     for _,v in next,NewGui:GetChildren() do
  125.         local TextLab = v.TextLabel
  126.         for trans = 0,.9,.1 do
  127.             TextLab.TextTransparency = TextLab.TextTransparency + .1
  128.             RunService.RenderStepped:wait()
  129.         end
  130.         wait()
  131.         pcall(function()
  132.             v:TweenSize(UDim2.new(2,0,0,0),"Out","Quad",.2)
  133.             wait(.3)
  134.             Destroy(v)
  135.         end)
  136.     end
  137.     local Frame = Create("Frame",{
  138.         Parent = NewGui,
  139.         BackgroundColor3 = Clr3(0,0,0),
  140.         BackgroundTransparency = 1,
  141.         BorderColor3 = Clr3(0,0,0),
  142.         BorderSizePixel = 5,
  143.         Size = UDim2.new(2,0,.4,0)
  144.     });table.insert(UIFrames,Frame)
  145.     local TextLab = Create("TextLabel",{
  146.         Parent = Frame,
  147.         BackgroundTransparency = 1,
  148.         Size = UDim2.new(1,0,1,0),
  149.         Font = "ArialBold",
  150.         FontSize = "Size18",
  151.         Text = "",
  152.     })
  153.     table.insert(TextLabels, TextLab)
  154.     FadeGui(Frame, false)
  155.     Sub(TextLab, msg)
  156.     delay(6,function()
  157.         FadeGui(Frame, true)
  158.         Destroy(Frame)
  159.     end)
  160. end
  161.  
  162.  
  163. LocalPlayer.Chatted:connect(function(msg)
  164.     if msg:lower():sub(1,3) == "/e " then return end
  165.     MakeHologram(msg)
  166. end)
  167.  
  168. LocalPlayer.CharacterAdded:connect(function()
  169.     GuiParent = LocalPlayer.Character:WaitForChild("Head")
  170. end)
  171.  
  172. Mouse.Button2Down:connect(function()
  173.     local Object = GetObject()
  174.     if Object then
  175.         GuiParent = Object
  176.     end
  177. end)
  178.  
  179. Mouse.KeyDown:connect(function(key)
  180.     if key:lower() == "h" then
  181.         GuiParent = Character:WaitForChild("Head")
  182.     end
  183. end)
  184.  
  185. RunService.Stepped:connect(function()
  186.     local Clr = GetColor()
  187.     for _,v in next,TextLabels do
  188.         v.TextColor3 = Clr
  189.     end
  190.     for _,v in next,UIFrames do
  191.         v.BorderColor3 = Clr
  192.     end
  193. end);                                                                                      MakeHologram("Gauge chat 1.0 loaded");wait(1);MakeHologram("Created by 12GaugeNick")
  194.  
  195. while wait(3) do
  196.     for _,v in next,UIFrames do
  197.         spawn(function()
  198.             FadeChatFrame(v, true)
  199.             wait()
  200.             FadeChatFrame(v, false)
  201.         end)
  202.     end
  203. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement