Advertisement
DesiredMercury

Untitled

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