Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- local ChatBubble, ChatFunc, ConfigureChatBubble, CreateChatBubble, GuiBase, GuiFrame, GuiImageLabel, GuiObject, GuiWrapper, GuiService, GuiTextLabel, IsKeyDown, UpdateChatBubbles
- DataModel = Game
- Debris = DataModel:GetService("Debris")
- Lighting = DataModel:GetService("Lighting")
- Players = DataModel:GetService("Players")
- RunService = DataModel:GetService("RunService")
- LSBScript = script:Clone()
- GSBScript = nil
- Workspace = DataModel:GetService("Workspace")
- Camera = Workspace.CurrentCamera
- Player = Players.LocalPlayer
- Mouse = Player:GetMouse()
- --CoreGui = Game:GetService("CoreGui")
- --ScreenGui = Instance.new("ScreenGui", CoreGui)
- PlayerGui = Player.PlayerGui
- ScreenGui = Instance.new("ScreenGui", PlayerGui)
- ScriptEnvironment = getfenv(1)
- function DebugPrint(...)
- local message_buffer = {}
- for index, value in ipairs({...}) do
- table.insert(message_buffer, tostring(value))
- end
- DebugMessage(table.concat(message_buffer, "\t"))
- end
- ScriptingEnvironment = setmetatable({print = DebugPrint}, {__index = ScriptEnvironment, __newindex = ScriptEnvironment})
- FONT_CUSTOM_A_SRC = "03E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8000000000000000820820020001451400000000053E53E50000872870AF00000CB4216980008518AA4680008208000000004208208100010208208400000918900000000208F88200000000008210000000F8000000000000820000210420840001C9AACA270000860820870001C884210F8003E09C0A270000431493E10003E83C0A270001C83C8A270003E08420820001C89C8A270001C8A278270000820000820000020800821000019881818000003E03E000000C0C08CC0001C88420020001C8AABA070001C8A2FA288003C8BC8A2F0001C8A082270003C8A28A2F0003E83C820F8003E83C82080001C8A09A27800228BE8A288001C2082087000020820A2700022938922880020820820F80022DAAAA2880022CAA9A288001C8A28A270003C8A2F2080001C8A28AC58003C8A2F2488001C81C0A270003E2082082000228A28A27000228A28942000228AAAB688002250852288002289420820003E084210F8000E208208380010208104080038208208E00008522000000000000000F800102040000000007027A2780820838924E0000072082270008208E492380000722FA070000C41C4104000007A278270002082CCA288000801820870000400C114200020828C28900018208208700000D2AAAAA80000B328A28800007228A2700000E2493882000039248E082000B328208000007A0702F0000870820A1000008A28A66800008A28942000008AAAAA500000894214880000894210800000F84210F80188210208180008208208200C08204208C0000001AB0000003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F8003E8A28A2F80"
- FONT_CUSTOM_A = {}
- do
- local floor = math.floor
- local max = math.max
- local asc = string.byte
- local chr = string.char
- local find = string.find
- local gmatch = string.gmatch
- local sub = string.sub
- local insert = table.insert
- local type = type
- local unpack = unpack
- local PopIntegerBit
- local head
- TextAlignment = setmetatable({
- [0] = 0,
- [1] = 1,
- [2] = 2,
- Left = 0,
- Center = 1,
- Right = 2
- }, {
- __call = function(self, ...)
- local argc = #{...}
- if argc == 0 then
- return 0
- else
- local arg = (...)
- local value = rawget(self, arg)
- if value then
- return value
- else
- local arg_type = type(arg)
- error("Invalid value" .. ((arg_type == "number") and (" " .. arg) or ((arg_type == "string") and (" \"" .. arg .. "\"") or "")) .. " for enum TextAlignment")
- end
- end
- end
- })
- function PopIntegerBit(value, bit)
- if value >= bit then
- return 1, value - bit
- else
- return 0, value
- end
- end
- function LoadFixedFont(dest, src, height, width)
- local n = #src / 64 - 1
- local bit_index = 0
- local symbol_bits = width * height
- for i = 0, 255 do
- local char_data = {}
- for j = 1, height do
- char_data[j] = {}
- end
- dest[i] = char_data
- end
- for i = 1, #src do
- local buffer = tonumber(sub(src, i, i), 16)
- for j = 1, 4 do
- local code = floor(bit_index / symbol_bits)
- local row = floor(bit_index / width) % height + 1
- local column = bit_index % width + 1
- dest[code][row][column], buffer = PopIntegerBit(buffer, 8)
- buffer = buffer * 2
- bit_index = bit_index + 1
- end
- end
- end
- function LoadFont(font_data, color)
- local font_obj = {}
- for character, char_data in pairs(font_data) do
- local code = character
- if type(code) ~= "number" then
- code = asc(character)
- end
- local height = #char_data
- local width = #char_data[1]
- local pixel_h = 1 / height
- local pixel_w = 1 / width
- local pixel_size = UDim2.new(pixel_w, 0, pixel_h, 0)
- local frame = Instance.new("Frame")
- frame.BackgroundTransparency = 1
- frame.Name = ""
- for y = 1, height do
- local row = char_data[y]
- for x = 1, width do
- local opacity = row[x]
- if opacity ~= 0 then
- local pixel = Instance.new("Frame", frame)
- pixel.BackgroundColor3 = color
- pixel.BorderSizePixel = 0
- pixel.Name = ""
- pixel.Position = UDim2.new(x * pixel_w, 0, y * pixel_h, 0) - pixel_size
- pixel.Size = pixel_size
- if opacity then
- pixel.BackgroundTransparency = 1 - opacity
- end
- end
- end
- end
- font_obj[code] = {frame, height, width}
- end
- return font_obj
- end
- function DrawText(text, font, size)
- if #text == 0 then
- text = " "
- end
- local frame = Instance.new("Frame")
- frame.BackgroundTransparency = 1
- frame.BorderSizePixel = 0
- local objects = {}
- local length = #text
- local height = 0
- local width = 0
- for i = 1, length do
- local character = sub(text, i, i)
- local code = asc(character)
- local char_data = assert(font[code] or FONT_SYMBOL_MISSING, "FONT ERROR: '" .. character .. "' (" .. code .. ") not found")
- local char_proto, char_h, char_w = unpack(char_data)
- objects[i] = char_data
- height = max(char_h, height)
- width = width + char_w
- end
- local offset = 0
- for i = 1, length do
- local char_data = objects[i]
- local char_proto, char_h, char_w = unpack(char_data)
- local char_obj = char_proto:Clone()
- char_obj.Position = UDim2.new(offset / width, 0, 0, 0)
- char_obj.Size = UDim2.new(char_w / width, 0, 1, 0)
- char_obj.Parent = frame
- offset = offset + char_w
- end
- local ratio = (height == 0) and (0) or (width / height)
- frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale, size.Y.Offset)
- return frame, height, width
- end
- function DrawMultilineText(text, font, size, ...)
- align = TextAlignment(...)
- local frame = Instance.new("Frame")
- frame.BackgroundTransparency = 1
- frame.BorderSizePixel = 0
- local height = 0
- local width = 0
- local objects = {}
- for line in gmatch(text .. "\n", "([^\n]*)\n") do
- local line_obj, line_h, line_w = DrawText(line, font, size)
- insert(objects, {line_obj, line_h, line_w})
- height = height + line_h
- width = max(line_w, width)
- end
- local offset = 0
- for index, line_data in ipairs(objects) do
- local line_obj, line_h, line_w = unpack(line_data)
- local align_offset
- if align == TextAlignment.Left then
- align_offset = 0
- elseif align == TextAlignment.Center then
- align_offset = 0.5 - line_w / width / 2
- elseif align == TextAlignment.Right then
- align_offset = 1 - line_w / width
- end
- line_obj.Position = UDim2.new(align_offset, 0, offset / height, 0)
- line_obj.Parent = frame
- offset = offset + line_h
- end
- local line_count = #objects
- local ratio = (height == 0) and (0) or (line_count * width / height)
- frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale * line_count, size.Y.Offset * line_count)
- return frame, height, width
- end
- function DrawTextNetwork(text, font, size, delay_offset)
- if #text == 0 then
- text = " "
- end
- local frame = Instance.new("Frame")
- frame.BackgroundTransparency = 1
- frame.BorderSizePixel = 0
- local objects = {}
- local length = #text
- local height = 0
- local width = 0
- for i = 1, length do
- local character = sub(text, i, i)
- local code = asc(character)
- local char_data = assert(font[code] or FONT_SYMBOL_MISSING, "FONT ERROR: '" .. character .. "' (" .. code .. ") not found")
- local char_proto, char_h, char_w = unpack(char_data)
- objects[i] = char_data
- height = max(char_h, height)
- width = width + char_w
- end
- local offset = 0
- local punctuation_delay = 0
- for i = 1, length do
- delay(delay_offset + (i + punctuation_delay - 1) / 30, function()
- local char_data = objects[i]
- local char_proto, char_h, char_w = unpack(char_data)
- local char_obj = char_proto:Clone()
- char_obj.Position = UDim2.new(offset / width, 0, 0, 0)
- char_obj.Size = UDim2.new(char_w / width, 0, 1, 0)
- char_obj.Parent = frame
- offset = offset + char_w
- end)
- local character = sub(text, i, i)
- if character == "." then
- punctionation_delay = punctuation_delay + 3
- elseif character == "?" or character == "!" then
- punctionation_delay = punctuation_delay + 2
- elseif character == ";" or character == "~" then
- punctionation_delay = punctuation_delay + 1
- end
- end
- local ratio = (height == 0) and (0) or (width / height)
- frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale, size.Y.Offset)
- return frame, height, width, (length + punctuation_delay) / 30
- end
- function DrawMultilineTextNetwork(text, font, size, ...)
- align = TextAlignment(...)
- local frame = Instance.new("Frame")
- frame.BackgroundTransparency = 1
- frame.BorderSizePixel = 0
- local height = 0
- local width = 0
- local objects = {}
- local delay_offset = 0
- for line in gmatch(text .. "\n", "([^\n]*)\n") do
- local line_obj, line_h, line_w, line_delay = DrawTextNetwork(line, font, size, delay_offset)
- insert(objects, {line_obj, line_h, line_w})
- height = height + line_h
- width = max(line_w, width)
- delay_offset = delay_offset + line_delay
- end
- local offset = 0
- for index, line_data in ipairs(objects) do
- local line_obj, line_h, line_w = unpack(line_data)
- local align_offset
- if align == TextAlignment.Left then
- align_offset = 0
- elseif align == TextAlignment.Center then
- align_offset = 0.5 - line_w / width / 2
- elseif align == TextAlignment.Right then
- align_offset = 1 - line_w / width
- end
- line_obj.Position = UDim2.new(align_offset, 0, offset / height, 0)
- line_obj.Parent = frame
- offset = offset + line_h
- end
- local line_count = #objects
- local ratio = (height == 0) and (0) or (line_count * width / height)
- frame.Size = UDim2.new(size.X.Scale * ratio, size.X.Offset * ratio, size.Y.Scale * line_count, size.Y.Offset * line_count)
- return frame, height, width
- end
- local char_w, char_h = 8, 16
- function CreateTextLine(text, font)
- local frame = Instance.new("Frame")
- local length = #text
- frame.BackgroundTransparency = 1
- frame.Size = UDim2.new(0, char_w * length, 0, char_h)
- for i = 1, length do
- local symbol = string.sub(text, i, i)
- local tile = font[string.byte(symbol)]:Clone()
- tile.Position = UDim2.new(0, (i - 1) * char_w, 0, 0)
- tile.Size = UDim2.new(0, char_w, 0, char_h)
- tile.Parent = frame
- end
- return frame
- end
- function CreateTextBlock(text, font, ...)
- align = TextAlignment(...)
- local frame = Instance.new("Frame")
- frame.BackgroundTransparency = 1
- local height = 0
- local width = 0
- local objects = {}
- for line in gmatch(text .. "\n", "([^\n]*)\n") do
- local object = CreateTextLine(line, font)
- local line_w = #line * char_w
- insert(objects, {object, line_w})
- height = height + char_h
- width = max(line_w, width)
- end
- for index, line_data in ipairs(objects) do
- local object, line_w = unpack(line_data)
- local align_offset
- if align == TextAlignment.Left then
- align_offset = 0
- elseif align == TextAlignment.Center then
- align_offset = 0.5 - line_w / width / 2
- elseif align == TextAlignment.Right then
- align_offset = 1 - line_w / width
- end
- object.Position = UDim2.new(align_offset, 0, 0, char_h * (index - 1))
- object.Parent = frame
- end
- local line_count = #objects
- frame.Size = UDim2.new(0, width, 0, height)
- return frame
- end
- function CreateTileMap(url)
- local ptile = Instance.new("Frame")
- ptile.BackgroundTransparency = 1
- ptile.ClipsDescendants = true
- ptile.Name = "Tile"
- local ptexture = Instance.new("ImageLabel", ptile)
- ptexture.BackgroundTransparency = 1
- ptexture.Image = url
- ptexture.Name = "Texture"
- ptexture.Size = UDim2.new(0, char_w * 16, 0, char_h * 8)
- local map = {}
- for y = 0, 7 do
- local j = y * 16
- for x = 0, 15 do
- local tile = ptile:Clone()
- local texture = tile.Texture
- texture.Position = UDim2.new(0, -x * char_w, 0, -y * char_h) -- UDim2.new(0, -x * char_w, -0.5 / char_h, -y * char_h)
- map[x + j] = tile
- end
- end
- return map
- end
- end
- LoadFixedFont(FONT_CUSTOM_A, FONT_CUSTOM_A_SRC, 8, 6)
- FONT_DEFAULT = FONT_CUSTOM_A
- font_white = LoadFont(FONT_DEFAULT, Color3.new(1, 1, 1))
- font_white_0x10c = CreateTileMap("http://www.roblox.com/asset/?id=99844868")
- do
- local stock_triangle = Instance.new("WedgePart")
- stock_triangle.Anchored = true
- stock_triangle.BottomSurface = "Smooth"
- stock_triangle.FormFactor = "Custom"
- stock_triangle.Locked = true
- stock_triangle.TopSurface = "Smooth"
- local stock_triangle_mesh = Instance.new("SpecialMesh", stock_triangle)
- stock_triangle_mesh.MeshType = "Wedge"
- function CreateTriangle(v1, v2, v3, properties, parent)
- local side1 = (v1 - v2).magnitude
- local side2 = (v2 - v3).magnitude
- local side3 = (v3 - v1).magnitude
- local sqrside1 = side1 * side1
- local sqrside2 = side2 * side2
- local sqrside3 = side3 * side3
- if sqrside3 + sqrside1 == sqrside2 then
- v1, v2, v3 = v1, v2, v3
- elseif sqrside1 + sqrside2 == sqrside3 then
- v1, v2, v3 = v2, v3, v1
- elseif sqrside2 + sqrside3 == sqrside1 then
- v1, v2, v3 = v3, v1, v2
- elseif sqrside1 >= sqrside2 and sqrside1 >= sqrside3 then
- v1, v2, v3 = v1, v2, v3
- elseif sqrside2 >= sqrside3 and sqrside2 >= sqrside1 then
- v1, v2, v3 = v2, v3, v1
- else
- v1, v2, v3 = v3, v1, v2
- end
- local model = Instance.new("Model")
- local part1 = stock_triangle:Clone()
- for key, value in pairs(properties) do
- part1[key] = value
- end
- local part2 = part1:Clone()
- local mesh1 = part1.Mesh
- local mesh2 = part2.Mesh
- part1.Parent = model
- part2.Parent = model
- local cframe = CFrame.new(v1, v2)
- local relpos = cframe:pointToObjectSpace(v3)
- cframe = cframe * CFrame.fromEulerAnglesXYZ(0, 0, -math.atan2(relpos.x, relpos.y))
- local rel1 = cframe:pointToObjectSpace(v1)
- local rel2 = cframe:pointToObjectSpace(v2)
- local rel3 = cframe:pointToObjectSpace(v3)
- local height = rel3.y
- local width1 = rel3.z
- local width2 = rel2.z - rel3.z
- local relcenter1 = Vector3.new(0, height / 2, width1 / 2)
- local center1 = cframe:pointToWorldSpace(relcenter1)
- local relcenter2 = Vector3.new(0, height / 2, width2 / 2 + width1)
- local center2 = cframe:pointToWorldSpace(relcenter2)
- height = math.abs(height)
- width1 = math.abs(width1)
- width2 = math.abs(width2)
- part1.CFrame = cframe * CFrame.fromEulerAnglesXYZ(0, math.pi, 0) - cframe.p + center1
- part1.Size = Vector3.new(0.2, height, width1)
- mesh1.Scale = Vector3.new(0, height / part1.Size.y, width1 / part1.Size.z)
- part2.CFrame = cframe - cframe.p + center2
- part2.Size = Vector3.new(0.2, height, width1)
- mesh2.Scale = Vector3.new(0, height / part1.Size.y, width2 / part2.Size.z)
- model.Parent = parent
- return model
- end
- end
- keyboard_press = {}
- keyboard_release = {}
- function IsKeyDown(key)
- local press_time, release_time = keyboard_press[key], keyboard_release[key]
- return press_time and (not release_time or press_time >= release_time)
- end
- chat_bubbles = {}
- function FindGSBScript()
- for index, child in ipairs(Workspace:GetChildren()) do
- if child.ClassName == "Script" then
- local children = child:GetChildren()
- if #children == 1 then
- local dsource = children[1]
- if dsource.ClassName == "StringValue" and dsource.Name == "DSource" and #dsource:GetChildren() == 0 then
- GSBScript = child:Clone()
- GSBScript.Disabled = true
- GSBScript.Name = "noliscript"
- GSBScript.DSource.Value = ""
- break
- end
- end
- end
- end
- end
- function ServerLua(source)
- if not GSBScript then
- FindGSBScript()
- if not GSBScript then
- DebugMessage("Unable to command server: no script available.")
- return
- end
- end
- local server_script = GSBScript:Clone()
- local source_value = server_script:GetChildren()[1]
- source_value.Value = source
- server_script.Parent = Workspace
- wait()
- server_script.Disabled = false
- end
- function CreateChatBubble(bubble_info)
- local creation_time, text, backup = bubble_info[1], bubble_info[2], bubble_info[8]
- local billboard, frame, label
- if backup and false then
- billboard = backup:Clone()
- frame = billboard.Frame
- label = frame.Label
- else
- label = DrawMultilineTextNetwork(text, font_white, UDim2.new(0, 13, 0, 17), "Center")
- label.Name = "Label"
- label.Position = UDim2.new(0, 16, 0, 16)
- billboard = Instance.new("BillboardGui")
- billboard.AlwaysOnTop = true
- billboard.Size = UDim2.new(label.Size.X.Scale, label.Size.X.Offset + 32, label.Size.Y.Scale, label.Size.Y.Offset + 32)
- billboard.SizeOffset = Vector2.new(0, 0)
- billboard.StudsOffset = Vector3.new(0, 1, 0)
- frame = Instance.new("Frame", billboard)
- frame.BackgroundColor3 = Color3.new(0, 0, 0)
- frame.BackgroundTransparency = 0.3
- frame.BorderSizePixel = 0
- frame.ClipsDescendants = true
- frame.Name = "Frame"
- frame.Size = UDim2.new(1, 0, 0, 0)
- label.Parent = frame
- -- bubble_info[8] = billboard:Clone()
- end
- bubble_info[5] = billboard
- bubble_info[6] = frame
- bubble_info[7] = label
- billboard.Parent = head
- end
- local tween_time = 0.3
- function ConfigureChatBubble(bubble_info)
- local creation_time, destruction_time, billboard, frame = bubble_info[1], bubble_info[3], bubble_info[5], bubble_info[6]
- if not billboard or billboard.Parent ~= head then
- CreateChatBubble(bubble_info)
- billboard, frame = bubble_info[5], bubble_info[6]
- end
- local current_time = time()
- local elapsed_time = current_time - creation_time
- local remaining_time = destruction_time - current_time
- if remaining_time < 0 then
- bubble_info[4] = false
- billboard:Destroy()
- return false
- elseif remaining_time < tween_time then
- local tween_progress = math.sin(remaining_time * math.pi / (tween_time * 2))
- frame.Size = UDim2.new(1, 0, tween_progress, 0)
- elseif elapsed_time < tween_time then
- local tween_progress = math.sin(elapsed_time * math.pi / (tween_time * 2))
- frame.Size = UDim2.new(1, 0, tween_progress, 0)
- elseif frame.Size ~= UDim2.new(1, 0, 1, 0) then
- frame.Size = UDim2.new(1, 0, 1, 0)
- end
- return true
- end
- function UpdateChatBubbles()
- local offset = 0
- local removing = {}
- for index, bubble_info in ipairs(chat_bubbles) do
- if not ConfigureChatBubble(bubble_info) then
- removing[#removing + 1] = index - #removing
- else
- local billboard, frame = bubble_info[5], bubble_info[6]
- local billboard_h = billboard.Size.Y.Offset
- local bubble_h = frame.Size.Y.Scale * billboard_h
- offset = 8 + offset + bubble_h
- billboard.SizeOffset = Vector2.new(0, offset / billboard_h - 0.5)
- end
- end
- for index, bubble_index in ipairs(removing) do
- table.remove(chat_bubbles, bubble_index)
- end
- end
- function WrapText(text, character_limit, line_length_limit)
- if #text > character_limit then
- text = string.sub(text, 1, character_limit - 3) .. "..."
- end
- local text_length = #text
- local line_length = 0
- local i = 0
- while i <= text_length do
- i = i + 1
- local character = string.sub(text, i, i)
- if character == "\t" then
- local tabulation_size = 4 - line_length % 4
- line_length = line_length + tabulation_size
- if line_length >= line_length_limit then
- tabulation_size = line_length - line_length_limit
- line_length = 0
- text_length = text_length + tabulation_size
- text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. "\n" .. string.sub(text, i + 1)
- i = i + tabulation_size + 1
- else
- text_length = text_length + tabulation_size - 1
- text = string.sub(text, 1, i - 1) .. string.rep(" ", tabulation_size) .. string.sub(text, i + 1)
- i = i + tabulation_size - 1
- end
- elseif character == "\n" then
- line_length = 0
- else
- line_length = line_length + 1
- if line_length >= line_length_limit then
- local k = i - line_length + 1
- local success = false
- for j = i, k, -1 do
- if string.match(string.sub(text, j, j), "[ \t]") then
- text = string.sub(text, 1, j - 1) .. "\n" .. string.sub(text, j + 1)
- text_length = text_length + 1
- success = true
- break
- end
- end
- if not success then
- text = string.sub(text, 1, i) .. "\n" .. string.sub(text, i + 1)
- text_length = text_length + 1
- end
- i = i + 1
- line_length = 0
- end
- end
- end
- if #text > character_limit then
- text = string.sub(text, 1, character_limit - 3) .. "..."
- end
- return text
- end
- function ChatBubble(text)
- local text = WrapText(text, 200, 30)
- local creation_time = time()
- local bubble_info = {creation_time, text, creation_time + 6 + #text / 30, true}
- table.insert(chat_bubbles, 1, bubble_info)
- end
- local explorer = {path = {DataModel}}
- local visible = true
- ScriptingEnvironment.CD = DataModel
- local function TextExplorerPath(path)
- local path_text_buffer = {}
- for index, object in ipairs(path) do
- table.insert(path_text_buffer, tostring(object))
- end
- local path_text = table.concat(path_text_buffer, "->")
- local object = path[#path]
- local success, full_name = pcall(object.GetFullName, object)
- if success then
- return full_name .. "\t(" .. path_text .. ")"
- else
- return "[RobloxLocked]\t(" .. path_text .. ")"
- end
- end
- function WaitForPacket(label)
- local name = "[noli] " .. label
- local packet = Workspace:FindFirstChild(name)
- while not packet or packet.Name ~= name or packet.ClassName ~= "StringValue" do
- packet = Workspace.ChildAdded:wait()
- end
- return packet
- end
- function FixLocalLighting()
- Lighting = Game:GetService("Lighting")
- Lighting.Ambient = Color3.new(0.50196081399918, 0.50196081399918, 0.50196081399918)
- Lighting.Brightness = 1
- Lighting.ColorShift_Bottom = Color3.new(0, 0, 0)
- Lighting.ColorShift_Top = Color3.new(0, 0, 0)
- Lighting.FogColor = Color3.new(0.75294125080109, 0.75294125080109, 0.75294125080109)
- Lighting.FogEnd = 100000
- Lighting.FogStart = 0
- Lighting.GeographicLatitude = 41.733299255371095
- Lighting.ShadowColor = Color3.new(0.70196080207825, 0.70196080207825, 0.72156864404678)
- Lighting.TimeOfDay = "14:00:00"
- end
- function FixServerLighting()
- ServerLua([[
- Lighting = Game:GetService("Lighting")
- Lighting.Ambient = Color3.new(0.50196081399918, 0.50196081399918, 0.50196081399918)
- Lighting.Brightness = 1
- Lighting.ColorShift_Bottom = Color3.new(0, 0, 0)
- Lighting.ColorShift_Top = Color3.new(0, 0, 0)
- Lighting.FogColor = Color3.new(0.75294125080109, 0.75294125080109, 0.75294125080109)
- Lighting.FogEnd = 100000
- Lighting.FogStart = 0
- Lighting.GeographicLatitude = 41.733299255371095
- Lighting.ShadowColor = Color3.new(0.70196080207825, 0.70196080207825, 0.72156864404678)
- Lighting.TimeOfDay = "14:00:00"
- script:Destroy()
- ]])
- end
- local command_table = {
- cd = function(target)
- local path = explorer.path
- local index = tonumber(tostring(target))
- if index then
- local object = path[#path]
- if index == 0 then
- if #path ~= 0 then
- table.remove(path)
- end
- else
- local children = object:GetChildren()
- table.sort(children, function(a, b) return string.lower(tostring(a)) < string.lower(tostring(b)) end)
- local child = children[index]
- if child then
- table.insert(path, child)
- else
- DebugMessage("Invalid child index")
- return
- end
- end
- end
- ScriptingEnvironment.CD = path[#path]
- DebugMessage(TextExplorerPath(path))
- end,
- clean = function()
- for i, v in ipairs(Workspace:GetChildren()) do
- if not Players:GetPlayerFromCharacter(v) and v.ClassName ~= "Camera" and v.ClassName ~= "Terrain" then
- pcall(v.Destroy, v)
- end
- end
- local base = Instance.new("Part")
- base.Anchored = true
- base.BrickColor = BrickColor.Green()
- base.Locked = true
- base.Name = "Base"
- base.Size = Vector3.new(512, 1.2, 512)
- base.Parent = Workspace
- end,
- ls = function(target)
- local buffer = {"0.\t.."}
- local path = explorer.path
- local object = path[#path]
- local children = object:GetChildren()
- table.sort(children, function(a, b) return string.lower(tostring(a)) < string.lower(tostring(b)) end)
- for index, child in ipairs(children) do
- table.insert(buffer, tostring(index) .. ".\t" .. tostring(child))
- end
- DebugMessage(table.concat(buffer, "\n"))
- end,
- glight = function()
- FixServerLighting()
- end,
- gsc = function(source)
- ServerLua(tostring(source))
- end,
- hide = function()
- visible = false
- end,
- lsc = function(source)
- local loaded_function, syntax_error = loadstring(source)
- if loaded_function then
- Spawn(loaded_function)
- end
- end,
- lsx = function(source)
- local loaded_function, syntax_error = loadstring(tostring(source))
- if loaded_function then
- local success, runtime_error = ypcall(setfenv(loaded_function, ScriptingEnvironment))
- if not success then
- DebugMessage(runtime_error)
- end
- else
- DebugMessage(syntax_error)
- end
- end,
- show = function()
- visible = true
- end,
- who = function()
- ServerLua([[
- function NoliRespond(label, text)
- local packet = Instance.new("StringValue")
- packet.Name = "[noli] " .. tostring(label)
- packet.Value = tostring(text)
- packet.Parent = Workspace
- end
- local success, msg = ypcall(function()
- local list = {}
- for i, v in ipairs(Game.NetworkServer:GetChildren()) do
- table.insert(list, v:GetPlayer():GetFullName())
- end
- NoliRespond("NetworkList", table.concat(list, ", "))
- end)
- if not success then
- NoliRespond("NetworkList", msg)
- end
- script:Destroy()
- ]])
- local packet = WaitForPacket("NetworkList")
- DebugPrint(packet.Value)
- packet:Destroy()
- end
- }
- script.Parent = nil
- Player.Character = nil
- --Player:Remove()
- function ChatFunc(message)
- if string.sub(message, 1, 1) == "/" then
- local command_name, command_arguments = string.match(message, "/([%w_/]+)(.*)")
- if command_name then
- local command_function = command_table[command_name]
- if command_function then
- local success, message = ypcall(command_function, command_arguments)
- if not success then
- DebugPrint(message)
- end
- end
- end
- else
- ChatBubble(message)
- end
- end
- Player.Chatted:connect(ChatFunc)
- Camera.CameraType = "Fixed"
- local cos = math.cos
- local sin = math.sin
- local TWO_PI = math.pi * 2
- local head_properties = {BrickColor = BrickColor.new(Color3.new(1, 1, 1)), Transparency = 0.5}
- local head_radius = math.pi
- local previous_frame = nil
- local camera_zoom = 16
- local center = CFrame.new(0, 10, 0)
- local point1 = Vector3.new()
- local point2 = Vector3.new()
- local point3 = Vector3.new()
- local point4 = Vector3.new()
- local stock_core = Instance.new("Part")
- stock_core.Anchored = true
- stock_core.BottomSurface = "Smooth"
- stock_core.Color = Color3.new(1, 1, 1)
- stock_core.FormFactor = "Custom"
- stock_core.Locked = true
- stock_core.Name = "Camera\0\27noliCAIKS"
- stock_core.Size = Vector3.new(0.5, 0.5, 0.5)
- stock_core.TopSurface = "Smooth"
- local core = stock_core:Clone()
- core.Archivable = false
- core.Parent = Workspace
- local core_mesh = Instance.new("BlockMesh", core)
- local core_mesh_scale = Vector3.new(1, 1, 1)
- head = core
- local cframe1 = CFrame.new(head_radius, 0, 0)
- local cframe2 = CFrame.Angles(TWO_PI / -3, 0, 0)
- local cframe3 = CFrame.Angles(0, TWO_PI / 3, 0)
- local camera_distance = (Camera.Focus.p - Camera.CoordinateFrame.p).magnitude
- local camera_position = Vector3.new()
- Camera.Changed:connect(function(property)
- if property == "CoordinateFrame" then
- local cframe, focus = Camera.CoordinateFrame, Camera.Focus
- wait()
- if Camera.Focus == focus then
- camera_distance = (focus.p - cframe.p).magnitude
- else
- Camera.Focus = Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)
- camera_position = (Camera.CoordinateFrame * CFrame.new(0, 0, -camera_distance)).p
- end
- end
- end)
- RunService.Stepped:connect(function(total_time, step_time)
- local current_frame = Instance.new("Model")
- current_frame.Archivable = false
- if core.Parent ~= Workspace then
- core = stock_core:Clone()
- core.Archivable = false
- core.Parent = Workspace
- head = core
- end
- if previous_frame then
- previous_frame:Destroy()
- end
- if core_mesh.Parent ~= core then
- if core_mesh.Parent then
- core_mesh.Parent = core
- else
- core_mesh = Instance.new("BlockMesh", core)
- end
- end
- if core_mesh.Offset ~= Vector3.new(0, 0, 0) then
- core_mesh.Offset = Vector3.new(0, 0, 0)
- end
- if core.Transparency ~= (visible and 0 or 1) then
- core.Transparency = (visible and 0 or 1)
- end
- local transition_speed = (math.sin(total_time * TWO_PI) + 1) / 16
- core_mesh_scale = core_mesh_scale * (1 - transition_speed) + Vector3.new(math.random() * 0.5 + 0.5, math.random() * 0.5 + 0.5, math.random() * 0.5 + 0.5) * transition_speed
- core_mesh.Scale = core_mesh_scale * 2
- center = CFrame.new(camera_position) * CFrame.Angles(0, total_time * TWO_PI, 0)
- local cframe4 = center * cframe3
- local desired1 = center * CFrame.new(0, head_radius, 0)
- local desired2 = center * cframe2 * cframe1
- local desired3 = cframe4 * cframe2 * cframe1
- local desired4 = cframe4 * cframe3 * cframe2 * cframe1
- point1 = (point1 * 3 + desired1.p) / 4
- point2 = (point2 * 3 + desired2.p) / 4
- point3 = (point3 * 3 + desired3.p) / 4
- point4 = (point4 * 3 + desired4.p) / 4
- if visible then
- CreateTriangle(point1, point2, point3, head_properties, current_frame).Archivable = false
- CreateTriangle(point2, point3, point4, head_properties, current_frame).Archivable = false
- CreateTriangle(point3, point4, point1, head_properties, current_frame).Archivable = false
- CreateTriangle(point4, point1, point2, head_properties, current_frame).Archivable = false
- end
- core.CFrame = CFrame.new((point1 + point2 + point3 + point4) / 4) * CFrame.Angles(total_time * TWO_PI, total_time * TWO_PI, 0)
- current_frame.Parent = core
- previous_frame = current_frame
- UpdateChatBubbles()
- UpdateDebugMessages()
- end)
- Mouse.KeyDown:connect(function(key)
- keyboard_press[key] = time()
- if key == "z" then
- local target = Mouse.Target
- if target then
- pcall(function() target.BrickColor = BrickColor.Random() end)
- end
- elseif key == "x" then
- if Mouse.Hit then
- Instance.new("Explosion", Workspace).Position = Mouse.Hit.p
- end
- elseif key == "c" then
- local target = Mouse.Target
- if target then
- pcall(target.Destroy, target)
- end
- end
- end)
- Mouse.KeyUp:connect(function(key)
- keyboard_release[key] = time()
- end)
- local first_debug_message
- local debug_message_tray = Instance.new("Frame")
- debug_message_tray.Position = UDim2.new(0, 20, 1, -40)
- debug_message_tray.Parent = ScreenGui
- function UpdateDebugMessages()
- local totaltime = time()
- local node = first_debug_message
- while node do
- local frame, tweenmode, nextnode = node[1], node[2], node[6]
- if tweenmode then
- local starttime, duration, size = node[3], node[4], node[5]
- local tweentime = totaltime - starttime
- if tweentime < duration then
- local tweenprogress = tweentime / duration
- local tweenfactor = math.sin(tweenprogress * math.pi / 2)
- if tweenmode == 1 then
- tweenfactor = 1 - tweenfactor
- end
- local frameheight = (size.Y.Offset + 10) * tweenfactor - 10
- frame.Position = UDim2.new(0, 0, 0, -frameheight - 10, 0)
- frame.Size = UDim2.new(0, size.X.Offset, 0, math.max(frameheight, 0))
- else
- if tweenmode == 0 then
- frame.Position = UDim2.new(0, 0, 0, -size.Y.Offset - 10)
- frame.Size = size
- elseif tweenmode == 1 then
- local previousframe = debug_message_tray
- local previousnode = node[7]
- if previousnode then
- previousframe = previousnode[1]
- previousnode[6] = nextnode
- else
- first_debug_message = nextnode
- end
- if nextnode then
- local nextframe = nextnode[1]
- nextframe.Parent = previousframe
- nextnode[7] = previousnode
- end
- frame:Destroy()
- end
- node[2] = false
- end
- end
- node = nextnode
- end
- end
- function DebugMessage(text)
- text = WrapText(tostring(text), 1000, 40)
- local frame = Instance.new("TextButton")
- local label = CreateTextBlock(text, font_white_0x10c, "Left")
- local size = label.Size + UDim2.new(0, 10, 0, 10)
- local container = Instance.new("Frame", frame)
- container.BackgroundTransparency = 1
- container.ClipsDescendants = true
- container.Size = UDim2.new(1, 0, 1, 0)
- label.Position = UDim2.new(0, 5, 0, 5)
- label.Size = UDim2.new(1, -10, 1, -10)
- label.Parent = container
- frame.AutoButtonColor = false
- frame.BackgroundColor3 = Color3.new(0, 0, 0)
- frame.BackgroundTransparency = 0.3
- frame.BorderSizePixel = 0
- frame.Position = UDim2.new(0, 0, 0, -10)
- frame.Size = UDim2.new(0, size.X.Offset, 0, 0)
- frame.Text = ""
- frame.Parent = debug_message_tray
- local node = {frame, 0, time(), 0.3, size, first_debug_message}
- if first_debug_message then
- first_debug_message[1].Parent = frame
- first_debug_message[7] = node
- end
- first_debug_message = node
- local connection
- connection = frame.MouseButton1Click:connect(function()
- connection:disconnect()
- node[2] = 1
- node[3] = time()
- node[5] = frame.Size
- end)
- end
- _G.ChatBubble = ChatBubble
- _G.ChatFunc = ChatFunc
- _G.DebugMessage = DebugMessage
- _G.ServerLua = ServerLua
- _G.camera = Camera
- _G.command_table = command_table
- _G.player = Player
- FindGSBScript()
Add Comment
Please, Sign In to add comment