Advertisement
DesiredMercury

Untitled

Feb 19th, 2019
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.91 KB | None | 0 0
  1.  
  2. local CurrentChannel = nil
  3.  
  4. local MainChannel = script.Parent.Frame.MainChannel
  5. local SDChannel = script.Parent.Frame.SDChannel
  6. local MTFChannel = script.Parent.Frame.MTFChannel
  7. local SCDChannel = script.Parent.Frame.SCDChannel
  8. local MDChannel = script.Parent.Frame.MDChannel
  9. local ETChannel = script.Parent.Frame.ETChannel
  10. local ISDChannel = script.Parent.Frame.ISDChannel
  11. local IAChannel = script.Parent.Frame.IAChannel
  12. local ECChannel = script.Parent.Frame.ECChannel
  13. local DEAChannel = script.Parent.Frame.DEAChannel
  14. local ADChannel = script.Parent.Frame.ADChannel
  15. local CDChannel = script.Parent.Frame.CDChannel
  16.  
  17. local TextService = game:GetService("TextService")
  18.  
  19. local ReceivingEvent = game.ReplicatedStorage.ChattedEvent
  20.  
  21. local TextBoxEvent = game.ReplicatedStorage.ChattedEvent
  22.  
  23. local PlayerEvent = game.ReplicatedStorage.PlayerEvent
  24.  
  25. local SendBackEvent = game.ReplicatedStorage.SendBackEvent
  26.  
  27.  
  28. local TextBox = script.Parent.Frame.TextBox
  29. local Contents = TextBox.Text
  30.  
  31. script.Parent.Frame.ChannelSelection.MainChannel.MouseButton1Down:Connect(function()
  32.    CurrentChannel = nil
  33.    CurrentChannel = MainChannel
  34.    MainChannel.Visible = true
  35.    SDChannel.Visible = false
  36.    MTFChannel.Visible = false
  37.    SCDChannel.Visible = false
  38.    MDChannel.Visible = false
  39.    ETChannel.Visible = false
  40.    ISDChannel.Visible = false
  41.    IAChannel.Visible = false
  42.    ECChannel.Visible = false
  43.    DEAChannel.Visible = false
  44.    ADChannel.Visible = false
  45.    CDChannel.Visible = false
  46.  
  47.    script.Parent.Frame.TextLabel.Text = "Current Channel: "..CurrentChannel.Name
  48.  
  49. end)
  50.  
  51. script.Parent.Frame.ChannelSelection.SDChannel.MouseButton1Down:Connect(function()
  52.    CurrentChannel = nil
  53.    CurrentChannel = SDChannel
  54.    MainChannel.Visible = false
  55.    SDChannel.Visible = true
  56.    MTFChannel.Visible = false
  57.    SCDChannel.Visible = false
  58.    MDChannel.Visible = false
  59.    ETChannel.Visible = false
  60.    ISDChannel.Visible = false
  61.    IAChannel.Visible = false
  62.    ECChannel.Visible = false
  63.    DEAChannel.Visible = false
  64.    ADChannel.Visible = false
  65.    CDChannel.Visible = false
  66.  
  67.    script.Parent.Frame.TextLabel.Text = "Current Channel: "..CurrentChannel.Name
  68.  
  69. end)
  70.  
  71.  
  72.  
  73. --[[function DoSomethingWithTheCall(sender, message)
  74.     local Template = game.Players.LocalPlayer.PlayerGui.ChatBox.Frame.ScrollingFrame.TextLabel
  75.     local ClonedTemplate = Template:Clone()
  76.     ClonedTemplate.Text = sender..": "..message
  77.     ClonedTemplate.Parent = Template.Parent
  78.     ClonedTemplate.TextTransparency = 0
  79.     script.Parent.CanvasPosition = script.Parent.CanvasPosition + Vector2.new(0,17)
  80.     script.Parent.CanvasSize= script.Parent.CanvasSize + UDim2.new(0,0, 0,17)  
  81. end--]]
  82.  
  83.  
  84.  
  85. local Mouse = game.Players.LocalPlayer:GetMouse()
  86.  
  87. Mouse.KeyDown:Connect(function(Key)
  88.     if Key:lower() == "/" then
  89.         script.Parent.Frame.TextBox:CaptureFocus()
  90.     end
  91. end)
  92.  
  93.  
  94. function DoSomethingWithTheTextCall(wait)
  95.  
  96.     local playerFrom = game.Players.LocalPlayer
  97.     local Contents = TextBox.Text  
  98.  
  99.     TextBoxEvent:FireServer(Contents)
  100.    
  101. end
  102.  
  103. TextBox.FocusLost:Connect(function()    
  104.    DoSomethingWithTheTextCall()
  105. end)
  106.  
  107.  
  108. if CurrentChannel == nil then
  109.     print("CurrentChannel, Nil Value, Error:1")
  110. else
  111.     print("Channel path found successfully.")  
  112. end
  113.  
  114. SendBackEvent.OnClientEvent:Connect(function(Contents2, SentPlayer)
  115.    
  116.     local Template = CurrentChannel.TextLabel
  117.     local ClonedTemplate = Template:Clone()
  118.  
  119.         ClonedTemplate.Text = SentPlayer.Name..": "..Contents2        
  120.         ClonedTemplate.Parent = Template.Parent
  121.         ClonedTemplate.TextTransparency = 0
  122.         CurrentChannel.CanvasPosition = CurrentChannel.CanvasPosition + Vector2.new(0,30)
  123.         CurrentChannel.CanvasSize= CurrentChannel.CanvasSize + UDim2.new(0,0, 0,17)
  124.  
  125. end)
  126.  
  127.  
  128.  
  129.    
  130.  
  131.  
  132.  
  133.  
  134. PlayerEvent:FireServer()
  135.  
  136.  
  137. --ReceivingEvent.OnClientEvent:Connect(DoSomethingWithTheCall)
  138.  
  139.  
  140. game:GetService("StarterGui"):SetCoreGuiEnabled("Chat", false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement