This commit is contained in:
Thomas G 2022-07-05 17:25:44 +10:00
parent e69b1c7c2e
commit 1147c75dd4
1 changed files with 0 additions and 86 deletions

View File

@ -1901,92 +1901,6 @@ local createReportAbuseDialog = function()
return shield
end
local createChatBar = function()
--Only show a chat bar if we are a NetworkClient
waitForChild(game, "NetworkClient")
waitForChild(game, "Players")
waitForProperty(game.Players, "LocalPlayer")
local chatBar = Instance.new("Frame")
chatBar.Name = "ChatBar"
chatBar.Size = UDim2.new(1, 0, 0, 22)
chatBar.Position = UDim2.new(0, 0, 1, 0)
chatBar.BackgroundColor3 = Color3.new(0,0,0)
chatBar.BorderSizePixel = 0
local chatBox = Instance.new("TextBox")
chatBox.Text = ""
chatBox.Visible = false
chatBox.Size = UDim2.new(1,-4,1,0)
chatBox.Position = UDim2.new(0,2,0,0)
chatBox.TextXAlignment = Enum.TextXAlignment.Left
chatBox.Font = Enum.Font.Arial
chatBox.ClearTextOnFocus = false
chatBox.FontSize = Enum.FontSize.Size14
chatBox.TextColor3 = Color3.new(1,1,1)
chatBox.BackgroundTransparency = 1
chatBox.Parent = chatBar
local chatButton = Instance.new("TextButton")
chatButton.Size = UDim2.new(1,-4,1,0)
chatButton.Position = UDim2.new(0,2,0,0)
chatButton.AutoButtonColor = false
chatButton.Text = "To chat click here or press \"/\" key"
chatButton.TextXAlignment = Enum.TextXAlignment.Left
chatButton.Font = Enum.Font.Arial
chatButton.FontSize = Enum.FontSize.Size14
chatButton.TextColor3 = Color3.new(1,1,1)
chatButton.BackgroundTransparency = 1
chatButton.Parent = chatBar
local activateChat = function()
if chatBox.Visible then
return
end
chatButton.Visible = false
chatBox.Text = ""
chatBox.Visible = true
chatBox:CaptureFocus()
end
chatButton.MouseButton1Click:connect(activateChat)
local hotKeyEnabled = true
local toggleHotKey = function(value)
hotKeyEnabled = value
end
local guiService = game:GetService("GuiService")
local newChatMode = pcall(function()
guiService:AddSpecialKey(Enum.SpecialKey.ChatHotkey)
guiService.SpecialKeyPressed:connect(function(key) if key == Enum.SpecialKey.ChatHotkey and hotKeyEnabled then activateChat() end end)
end)
if not newChatMode then
guiService:AddKey("/")
guiService.KeyPressed:connect(function(key) if key == "/" and hotKeyEnabled then activateChat() end end)
end
chatBox.FocusLost:connect(
function(enterPressed)
if enterPressed then
if chatBox.Text ~= "" then
local str = chatBox.Text
if string.sub(str, 1, 1) == '%' then
game.Players:TeamChat(string.sub(str, 2))
else
game.Players:Chat(str)
end
end
end
chatBox.Text = ""
chatBox.Visible = false
chatButton.Visible = true
end)
robloxLock(chatBar)
return chatBar, toggleHotKey
end
--Spawn a thread for the Save dialogs
local isSaveDialogSupported = pcall(function() local var = game.LocalSaveEnabled end)
if isSaveDialogSupported then