Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Gui = script.Parent
- local Player = Gui.Parent.Parent
- local MsgsF = Gui.MsgsF
- local Font_Sizes = {
- {symbol=" ",X=7,Y=27},
- {symbol=" ",X=28,Y=27},
- {symbol="!",X=7,Y=27},
- {symbol=[["]],X=9,Y=27},
- {symbol="#",X=14,Y=27},
- {symbol="$",X=14,Y=27},
- {symbol="%",X=22,Y=27},
- {symbol="&",X=17,Y=27},
- {symbol="'",X=5,Y=27},
- {symbol="(",X=9,Y=27},
- {symbol=")",X=9,Y=27},
- {symbol="*",X=10,Y=27},
- {symbol="+",X=15,Y=27},
- {symbol=",",X=7,Y=27},
- {symbol="-",X=9,Y=27},
- {symbol=".",X=7,Y=27},
- {symbol="/",X=7,Y=27},
- {symbol="0",X=14,Y=27},
- {symbol="1",X=14,Y=27},
- {symbol="2",X=14,Y=27},
- {symbol="3",X=14,Y=27},
- {symbol="4",X=14,Y=27},
- {symbol="5",X=14,Y=27},
- {symbol="6",X=14,Y=27},
- {symbol="7",X=14,Y=27},
- {symbol="8",X=14,Y=27},
- {symbol="9",X=14,Y=27},
- {symbol=":",X=7,Y=27},
- {symbol=";",X=7,Y=27},
- {symbol="<",X=15,Y=27},
- {symbol="=",X=15,Y=27},
- {symbol=">",X=15,Y=27},
- {symbol="?",X=14,Y=27},
- {symbol="@",X=26,Y=27},
- {symbol="A",X=17,Y=27},
- {symbol="B",X=17,Y=27},
- {symbol="C",X=18,Y=27},
- {symbol="D",X=18,Y=27},
- {symbol="E",X=17,Y=27},
- {symbol="F",X=16,Y=27},
- {symbol="G",X=20,Y=27},
- {symbol="H",X=18,Y=27},
- {symbol="I",X=7,Y=27},
- {symbol="J",X=13,Y=27},
- {symbol="K",X=17,Y=27},
- {symbol="L",X=14,Y=27},
- {symbol="M",X=21,Y=27},
- {symbol="N",X=18,Y=27},
- {symbol="O",X=20,Y=27},
- {symbol="P",X=17,Y=27},
- {symbol="Q",X=20,Y=27},
- {symbol="R",X=18,Y=27},
- {symbol="S",X=17,Y=27},
- {symbol="T",X=16,Y=27},
- {symbol="U",X=18,Y=27},
- {symbol="V",X=17,Y=27},
- {symbol="W",X=24,Y=27},
- {symbol="X",X=17,Y=27},
- {symbol="Y",X=17,Y=27},
- {symbol="Z",X=16,Y=27},
- {symbol="[",X=7,Y=27},
- {symbol=[[\]],X=7,Y=27},
- {symbol="]",X=7,Y=27},
- {symbol="^",X=12,Y=27},
- {symbol="_",X=14,Y=27},
- {symbol="`",X=9,Y=27},
- {symbol="a",X=14,Y=27},
- {symbol="b",X=14,Y=27},
- {symbol="c",X=13,Y=27},
- {symbol="d",X=14,Y=27},
- {symbol="e",X=14,Y=27},
- {symbol="f",X=7,Y=27},
- {symbol="g",X=14,Y=27},
- {symbol="h",X=14,Y=27},
- {symbol="i",X=6,Y=27},
- {symbol="j",X=6,Y=27},
- {symbol="k",X=13,Y=27},
- {symbol="l",X=6,Y=27},
- {symbol="m",X=21,Y=27},
- {symbol="n",X=14,Y=27},
- {symbol="o",X=14,Y=27},
- {symbol="p",X=14,Y=27},
- {symbol="q",X=14,Y=27},
- {symbol="r",X=9,Y=27},
- {symbol="s",X=13,Y=27},
- {symbol="t",X=7,Y=27},
- {symbol="u",X=14,Y=27},
- {symbol="v",X=13,Y=27},
- {symbol="w",X=18,Y=27},
- {symbol="x",X=13,Y=27},
- {symbol="y",X=13,Y=27},
- {symbol="z",X=13,Y=27},
- {symbol="{",X=9,Y=27},
- {symbol="|",X=7,Y=27},
- {symbol="}",X=9,Y=27},
- {symbol="~",X=15,Y=27}}
- function getTextLength(Text)
- local FSize = 11
- local Size = 0
- for z=1, #Text do
- local text = string.sub(Text,z,z)
- for _,Symbol in pairs(Font_Sizes) do
- if text == Symbol.symbol then
- Size = Size+(Symbol.X*(FSize/19.1))
- break
- end
- end
- end
- return Size
- end
- MsgsF.ChildAdded:connect(function(Child)
- local Msgs = MsgsF:children()
- if #Msgs > 10 then
- Msgs[1]:remove()
- end
- end)
- function Chat(Msg,PlayerChatted)
- local Msgs = MsgsF:children()
- local MsgN = Instance.new("TextButton")
- local MsgT = Instance.new("TextButton")
- MsgN.Name = "ChatMessage"
- MsgN.BorderSizePixel = 0
- MsgN.FontSize = Enum.FontSize.Size11
- MsgN.AutoButtonColor = false
- MsgN.BackgroundColor3 = Color3.new(0,0,0)
- if #Msgs > 0 then
- MsgN.Position = Msgs[#Msgs].Position + UDim2.new(0,0,0,20)
- end
- MsgN.Parent = MsgsF
- MsgT.Name = "Message"
- MsgT.BorderSizePixel = 0
- MsgT.FontSize = Enum.FontSize.Size11
- MsgT.AutoButtonColor = false
- MsgT.Text = " "..Msg.." "
- if MsgT.Text == "Button" then
- MsgT.Text = " [ Content Deleted ] "
- end
- MsgT.Size = UDim2.new(0,getTextLength(MsgT.Text),0,20)
- MsgT.Position = UDim2.new(1,0,0,0)
- MsgT.BackgroundColor3 = Color3.new(0,0,0)
- MsgT.Parent = MsgN
- if PlayerChatted == "[ Game ]" then
- MsgN.Text = " [ Game ] : "
- MsgN.Size = UDim2.new(0,getTextLength(MsgN.Text),0,20)
- MsgN.TextColor3 = Color3.new(0,0,0)
- MsgT.TextColor3 = Color3.new(0,0,0)
- elseif PlayerChatted == "[ Help Bot ]" then
- MsgN.Text = " [ Help Bot ] : "
- MsgN.Size = UDim2.new(0,getTextLength(MsgN.Text),0,20)
- MsgN.TextColor3 = Color3.new(0,0,0)
- MsgT.TextColor3 = Color3.new(0,0,0)
- else
- MsgN.Text = " "..PlayerChatted.Name.." : "
- MsgN.Size = UDim2.new(0,getTextLength(MsgN.Text),0,20)
- if PlayerChatted == Player then
- MsgN.TextColor3 = Color3.new(1,0,0)
- MsgT.TextColor3 = Color3.new(1,0,0)
- elseif PlayerChatted:IsBestFriendsWith(Player.userId) then
- MsgN.TextColor3 = Color3.new(0.5,0,1)
- MsgT.TextColor3 = Color3.new(0.5,0,1)
- elseif PlayerChatted:IsFriendsWith(Player.userId) then
- MsgN.TextColor3 = Color3.new(0,0,1)
- MsgT.TextColor3 = Color3.new(0,0,1)
- else
- MsgN.TextColor3 = Color3.new(0,1,0)
- MsgT.TextColor3 = Color3.new(0,1,0)
- end
- end
- for i = 0, 1, 0.2 do
- MsgN.BackgroundTransparency = 1-(i*0.2)
- MsgN.TextTransparency = 1-i
- MsgT.BackgroundTransparency = 1-(i*0.1)
- MsgT.TextTransparency = 1-i
- wait(0.1)
- end
- local Fade = Instance.new("ImageLabel")
- Fade.BorderSizePixel = 0
- Fade.BackgroundTransparency = 1
- Fade.Image = "http://www.roblox.com/asset/?id=36469741"
- Fade.Size = UDim2.new(0,MsgN.Size.X.Offset+MsgT.Size.X.Offset,0,20)
- Fade.Parent = MsgN
- end
- for _,PlayerChatted in pairs(game.Players:children()) do
- PlayerChatted.Chatted:connect(function(Msg) Chat(Msg,PlayerChatted) end)
- end
- game.Players.ChildAdded:connect(function(PlayerChatted)
- PlayerChatted.Chatted:connect(function(Msg) Chat(Msg,PlayerChatted) end)
- end)
- game.Chat.Chatted:connect(function(Obj,Msg)
- local player = game.Players:playerFromCharacter(Obj)
- if not player and Obj.Name == "Head" and Obj:findFirstChild("Dialog") == nil then
- Chat(Msg, "[ Help Bot ]")
- end
- end)
- while true do wait(0.1)
- for i,Msg in pairs(MsgsF:children()) do
- local WantY,CurY = (i-1)*20,Msg.Position.Y.Offset
- if WantY < CurY then
- local MoveY = CurY-4
- if MoveY < WantY then MoveY = WantY end
- Msg.Position = UDim2.new(0,0,0,MoveY)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement