Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function C3(r,g,b)
- return Color3.new(r/255,g/255,b/255)
- end
- local Settings = {
- ["GameName"] = "the game";
- ["ConsoleName"] = "SERVER";
- ["ConsoleColor"] = C3(0,192,128);
- ["WelcomeMessage"] = true;
- ["PlayerJoinMessage"] = true;
- ["PlayerLeaveMessage"] = true;
- ["RandomChatColor"] = true;
- ["DefaultChatColor"] = C3(192,192,192);
- ["ChatColors"] = {
- C3(192,192,192);
- C3(32,192,32);
- C3(16,192,192);
- C3(255,32,32);
- C3(64,64,255);
- C3(255,96,255);
- C3(255,16,255);
- C3(255,255,64);
- }
- }
- function addMessage(speaker,msg,chat,color)
- for i,v in pairs(chat:GetChildren()) do
- if v:IsA("Frame") and string.sub(v.Name,1,7) then
- v.ActualPosition.Value = v.ActualPosition.Value-32
- v:TweenPosition(UDim2.new(0,5,0,v.ActualPosition.Value),"Out","Sine",0.5,true)
- v.Name = "Message"..tostring(tonumber(string.sub(v.Name,8))+1)
- if v.Name == "Message6" then
- v:TweenPosition(UDim2.new(0,5,0,-62),"Out","Sine",0.5,true)
- game:GetService("Debris"):AddItem(v,0.5)
- end
- end
- end
- local ChatFrame = Instance.new("Frame",chat)
- ChatFrame.Name = "Message1"
- ChatFrame.BackgroundTransparency = 1
- ChatFrame.Position = UDim2.new(0,5,0,149)
- ChatFrame.Size = UDim2.new(0,0,0,32)
- local ActualPosition = Instance.new("IntValue",ChatFrame)
- ActualPosition.Name = "ActualPosition"
- ActualPosition.Value = 149
- local Name = Instance.new("TextLabel",ChatFrame)
- Name.Name = "Name"
- Name.BackgroundTransparency = 1
- Name.TextColor3 = color
- Name.TextStrokeTransparency = 0.5
- Name.Font = "SourceSans"
- Name.FontSize = "Size18"
- Name.Text = speaker
- Name.Size = UDim2.new(0,Name.TextBounds.X,0,Name.TextBounds.Y)
- Name.ZIndex = 2
- local Message = Instance.new("TextLabel",ChatFrame)
- Message.Name = "Message"
- Message.BackgroundTransparency = 1
- Message.TextColor3 = Color3.new(255,255,255)
- Message.Font = "SourceSansLight"
- Message.FontSize = "Size18"
- Message.TextXAlignment = "Left"
- Message.TextYAlignment = "Top"
- Message.TextWrapped = true
- Message.Text = msg
- Message.Size = UDim2.new(0,350,0,36)
- Message.Position = UDim2.new(0,Name.TextBounds.X+2,0,0)
- Message.ZIndex = 2
- local Shadow = Message:Clone()
- Shadow.Parent = Message
- Shadow.TextColor3 = Color3.new(0,0,0)
- Shadow.Position = UDim2.new(0,-1,0,1)
- Shadow.ZIndex = 1
- end
- game.Players.PlayerAdded:connect(function(plr)
- if Settings.RandomChatColor == true and #Settings.ChatColors > 0 then
- math.randomseed(os.time())
- plrColor = Settings.ChatColors[math.random(1,#Settings.ChatColors)]
- else
- plrColor = Settings.DefaultChatColor
- end
- local chatGUI = Instance.new("ScreenGui",plr:WaitForChild("PlayerGui"))
- chatGUI.Name = "ChatGUI"
- if Settings.WelcomeMessage == true then
- addMessage("["..Settings.ConsoleName.."]","Welcome to "..Settings.GameName.." "..plr.Name.."!",chatGUI,Settings.ConsoleColor)
- end
- if Settings.PlayerJoinMessage == true then
- for i,v in pairs(game.Players:GetChildren()) do
- if v ~= plr then
- addMessage("["..Settings.ConsoleName.."]",plr.Name.." has joined "..Settings.GameName.."!",v.PlayerGui.ChatGUI,Settings.ConsoleColor)
- end
- end
- end
- plr.Chatted:connect(function(msg)
- for i,v in pairs(game.Players:GetChildren()) do
- addMessage("["..plr.Name.."]",msg,v.PlayerGui.ChatGUI,plrColor)
- end
- end)
- end)
- game.Players.PlayerRemoving:connect(function(plr)
- if Settings.PlayerLeaveMessage == true then
- for i,v in pairs(game.Players:GetChildren()) do
- if v ~= plr then
- addMessage("["..Settings.ConsoleName.."]",plr.Name.." has left "..Settings.GameName.."!",v.PlayerGui.ChatGUI,Settings.ConsoleColor)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement