Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait()
- script.Parent = workspace
- Camera=workspace.CurrentCamera
- Player=owner
- Create=LoadLibrary'RbxUtility'.Create
- Core={
- SystemCall='>',
- Color=BrickColor.new('Really black');
- OutlineColor=BrickColor.new('Institutional white');
- TextColor=BrickColor.new('Institutional white');
- };
- local s = {
- Players = game:getService('Players'),
- Workspace = game:getService('Workspace'),
- RunService = game:getService('RunService');
- }
- local chats = {}
- local NextRainbowColor = Color3.new()
- local function HSLtoRGB(hue, sat, light)
- local c = light > .5 and (2 - 2 * light) * sat or (2 * light) * sat
- local h2 = hue / 60
- local x = c * (1 - math.abs((h2 % 2) - 1))
- local rgbvals = {{c, x, 0}, {x, c, 0}, {0, c, x}, {0, x, c}, {x, 0, c}, {c, 0, x}}
- local rgb = rgbvals[math.floor(h2) + 1]
- for i = 1, 3 do rgb[i] = rgb[i] + (light - .5 * c) end
- return Color3.new(rgb[1], rgb[2], rgb[3])
- end
- spawn(function()
- while wait() do
- for i = 0,350,5 do -- Heres how fast it changes colours
- pcall(function() NextRainbowColor = HSLtoRGB(i,1,0.5) end)
- s.RunService.Stepped:wait()
- end
- end
- end)
- local Dark =Color3.new("Really black")
- local Purple =Color3.new("Royal purple")
- function color(r,g,b)
- return Color3.new(r/255,g/255,b/255)
- end
- Player.CharacterAdded:connect(function()
- for i,v in next,chats do
- v.Removed = true
- end
- end)
- function Chat(msg,dark)
- 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
- coroutine.wrap(function()
- delay(0,function()
- local isDark = dark or false
- local y = -40
- for i = #chats,1,-1 do
- local v = chats[i]
- if v.Removed == false then
- y = y - 40
- v.Message:TweenPosition(UDim2.new(.5,v.Message.Position.X.Offset,1,y),"In","Linear",0.5,true,function()
- if v.Message.Position.Y.Offset <= -40*4 then
- v.Remove = true
- end
- end)
- end
- end
- local bg = Instance.new('BillboardGui',Create'Part'{Anchored=true,Transparency=1,CanCollide=false,Parent=Instance.new('Script', workspace),CFrame=workspace.CurrentCamera.CoordinateFrame})
- bg.Name = 'Chat'
- bg.StudsOffset = Vector3.new(0,7,0)
- bg.Adornee = bg.Parent
- bg.Size = UDim2.new(75,0,11,0)
- bg.AlwaysOnTop = true
- game:service'RunService'.Stepped:connect(function()
- if bg.Parent~=nil then
- if Player.Character~=nil then
- bg.Parent.CFrame=Player.Character.Head.CFrame
- end
- end
- end)
- local mesg = ""
- for i = 1, #msg do
- mesg = mesg .. msg:sub(i,i) .. "\1"
- end
- local tl = Instance.new('TextBox',bg)
- tl.Text = mesg
- tl.Name = "Message"
- tl.BorderSizePixel = 0
- tl.ClipsDescendants = true
- tl.BackgroundTransparency = 0
- tl.TextTransparency = 1
- if isDark then
- tl.TextColor = BrickColor.new('Magenta')
- else
- tl.TextColor = BrickColor.new('White')
- end
- tl.FontSize = 5
- tl.Font =("SourceSansBold")
- tl.Size = UDim2.new(0,tl.TextBounds.X+25,0,0)
- tl.Position = UDim2.new(.5,(-tl.TextBounds.X-25)/2,1,0)
- 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)
- local spot = #chats+1
- chats[spot] = {Message = tl,Removed = false,Remove = false}
- local r,g,b = math.random(1,255),math.random(1,255),math.random(1,255)
- local rr,gr,br = false,false,false
- local removed = false
- delay(0,function()
- for i = 1,.5,-.05 do
- wait(0.05)
- tl.BackgroundTransparency = i
- end
- end)
- delay(0,function()
- for i = 1,0,-.1 do
- wait(0.05)
- tl.TextTransparency = i
- end
- end)
- delay(0,function()
- while removed == false do
- wait(0.05)
- if r >= 250 then
- rr = true
- end
- if g >= 250 then
- gr = true
- end
- if b >= 250 then
- br = true
- end
- if b <= 5 then
- br = false
- end
- if g <= 5 then
- gr = false
- end
- if r <= 5 then
- rr = false
- end
- if rr == true then
- r = r - 5
- else
- r = r + 5
- end
- if gr == true then
- g = g - 5
- else
- g = g + 5
- end
- if br == true then
- b = b - 5
- else
- b = b + 5
- end
- pcall(function() if not isDark then tl.BackgroundColor3 = NextRainbowColor else tl.BackgroundColor = BrickColor.new("Really black") end end)
- end
- end)
- local remove = false
- delay(0,function()
- wait(3)
- remove = true
- end)
- delay(0,function()
- while remove == false do
- wait()
- if chats[spot].Remove == true then
- remove = true
- end
- end
- end)
- delay(0,function()
- repeat wait() until remove == true
- delay(0,function()
- for i = .5,1,.05 do
- wait(0.05)
- tl.BackgroundTransparency = i
- end
- end)
- delay(0,function()
- for i = 0,1,.1 do
- wait(0.05)
- tl.TextTransparency = i
- end
- bg:remove()
- removed = true
- chats[spot].Removed = true
- end)
- end)
- end)
- end)()
- end
- Player.Chatted:connect(function(msg)
- Chat(msg)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement