Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clone = script.Parent.Default:Clone()
- frontsize = 30
- buffer = 5
- lines = 10
- linesize = fontsize + buffer * 2
- script.Parent.Size = UDim2.new(0.3, 0, 0, linesize * lines)
- script.Parent.Default.Position = UDim2.new(0, 0, 0, linesize * lines - linesize)
- script.Parent.Default.FontSize = "Size"..fontsize
- --------------------------------------
- ranks = { [1] = "Enlist",
- [2] = "Private",
- [3] = "Corporal",
- [4] = "Sergeant",
- [5] = "Staff Sergeant",
- [6] = "First Sergeant",
- [7] = "Sergeant Major",
- [8] = "Warrant Officer",
- [9] = "Second Lieutenant",
- [10] = "First Lieutenant",
- [11] = "CiT",
- [12] = "DP",
- [12+1] = "Captain",
- [13+1] = "Major",
- [14+1] = "Colonel",
- [15+1] = "Major General",
- [16+1] = "Lieutenant General",
- [17+1] = "General",
- [18+1] = "Commander"
- }
- function shiftup()
- for _, a in pairs(script.Parent:GetChildren()) do
- if a.Name == "Chat" then
- shared[a].True = shared[a].True + UDim2.new(0, 0, 0, -linesize)
- a:TweenPosition(shared[a].True, "Out", "Quad", 0.157, true)
- end
- end
- end
- function Chat(msg, plr, rankoverride)
- shiftup()
- local text = clone:Clone()
- text.Visible = true
- text.Text = msg
- text.Name = "Chat"
- if plr:IsInGroup(226584) or rankoverride then
- if not rankoverride then
- local rank = Player:GetRankInGroup(226584)
- else
- rank = rankoverride
- end
- text.Text = "["..ranks[rank].."] "..plr.Name..": "..text.Text
- if rank >= 13 then
- text.TextColor3 = Color3.new(0, 0, 127/225)
- else
- text.TextColor3 = Color3.new(28/225, 43/225, 1)
- end
- else
- text.Text = "[Visitor] "..plr.Name..": "..text.Text
- end
- text.Position = text.Position + UDim2.new(0, 0, 0, linesize)
- text.Parent = script.Parent
- text:TweenPosition(UDim2.new(0, 0, 0, linesize * lines - linesize), "Out", "Quad", 0.157, true)
- shared[text] = {}
- shared[text].True = UDim2.new(0, 0, 0, linesize * lines - linesize)
- Lines = text.TextBounds.Y / fontsize --18 is the font size
- for i = 1, Lines - 1 do
- shiftup()
- end
- text.Size = UDim2.new(1, 0, 0, linesize * Lines)
- game:GetService("Debris"):AddItem(text, 60)
- end
- game.Players.PlayerAdded:connect(function (plr)
- plr.Chatted:connect(function (m)
- Chat(m, plr)
- end)
- end)
- for _, plr in pairs(game.Players:GetChildren()) do
- plr.Chatted:connect(function (m)
- Chat(m, plr)
- end)
- end
- _G.chat = Chat
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement