Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local newMessage = {}
- function typeWrite(delay, message)
- local A_1 = "Dialogue"
- local A_2 =
- {
- [1] =
- {
- ["Delay"] = delay,
- ["Text"] = message,
- }
- }
- local Event = game:GetService("ReplicatedStorage").Event
- Event:FireServer(A_1, A_2)
- end
- function newMessage:CreateMessage()
- local Message = Instance.new("ScreenGui")
- local DialogueHUD = Instance.new("Frame")
- local UIListLayout = Instance.new("UIListLayout")
- Message.Name = "Message"
- Message.Parent = game.CoreGui
- Message.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- DialogueHUD.Name = "DialogueHUD"
- DialogueHUD.Parent = Message
- DialogueHUD.BackgroundColor3 = Color3.new(1, 1, 1)
- DialogueHUD.BackgroundTransparency = 1
- DialogueHUD.Position = UDim2.new(0, 0, 1, 0)
- DialogueHUD.Size = UDim2.new(1, 0, 0, -200)
- UIListLayout.Parent = DialogueHUD
- UIListLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
- UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
- local epicLibrary = {}
- function epicLibrary:NewText(Text, Delay, Color, t2)
- local ch = false
- if Color ~= nil then
- local TextLabel = Instance.new("TextLabel")
- TextLabel.Parent = DialogueHUD
- TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel.BackgroundTransparency = 1
- TextLabel.BorderSizePixel = 0
- TextLabel.Position = UDim2.new(0, 0, 1, 0)
- TextLabel.Size = UDim2.new(1, 0, -0, 42)
- TextLabel.Font = Enum.Font.GothamBold
- TextLabel.TextColor3 = Color
- TextLabel.TextScaled = false
- TextLabel.TextSize = 24
- TextLabel.Text = Text
- TextLabel.TextWrapped = true
- typeWrite(Delay, t2)
- ch = true
- while wait() do
- if ch then
- if game.Players.LocalPlayer.PlayerGui.MessageGUI.DialogueHUD.BG.ImageTransparency == 1 then
- for i,v in pairs(DialogueHUD:GetChildren()) do
- if string.find(v.Name, "TextLabel") then
- v:Destroy()
- end
- end
- ch = false
- end
- end
- end
- end
- end
- return epicLibrary
- end
- return newMessage
Add Comment
Please, Sign In to add comment