local Player = game:GetService("Players").LocalPlayer local Mode = "Chat" local Hotkeys = { [92] = "Chat";--Backslash \ [27] = "Toggle"--F2 } local Hotkeys2 = {} for i,v in pairs(Hotkeys) do Hotkeys2[v] = i end local Modes = {[1] = "Chat",[2] = "ExecuteMode"} local PropertyChange = { Chat = { ClickChat = { Text = [[To chat click here or press "]]..string.char(Hotkeys2.Chat)..[[" key]]; TextColor3 = Color3.new(1,1,0.9) }; ChatBar = { BackgroundColor3 = Color3.new(0,0,0); TextColor3 = Color3.new(1,1,1) } }; ExecuteMode = { ClickChat = { Text = [[EXECUTE MODE: To execute code click here or press "]]..string.char(Hotkeys2.Chat)..[[" key]]; TextColor3 = Color3.new(0,0,0) }; ChatBar = { BackgroundColor3 = Color3.new(1,1,1); TextColor3 = Color3.new(0,0,0) } } } local ChatGui = Instance.new("ScreenGui",Player.PlayerGui) ChatGui.Name = "ChatBar" local ClickChat = Instance.new("TextButton",ChatGui) ClickChat.Size = UDim2.new(1,0,0,20) ClickChat.Position = UDim2.new(0,0,1,-20) ClickChat.BackgroundTransparency = 1 ClickChat.ZIndex = 2 ClickChat.Text = [[To chat click here or press "]]..string.char(Hotkeys2.Chat)..[[" key]] ClickChat.TextColor3 = Color3.new(1,1,0.9) ClickChat.TextXAlignment = "Left" ClickChat.FontSize = "Size12" local ChatBar = Instance.new("TextBox",ChatGui) ChatBar.Size = UDim2.new(1,0,0,20) ChatBar.Position = UDim2.new(0,0,1,-20) ChatBar.Text = "" ChatBar.ZIndex = 1 ChatBar.BackgroundColor3 = Color3.new(0,0,0) ChatBar.BackgroundTransparency = 0.25 ChatBar.TextXAlignment = "Left" ChatBar.TextColor3 = Color3.new(1,1,1) ChatBar.FontSize = "Size12" ChatBar.ClearTextOnFocus = false ChatBar.Text = "" local Parts = {ClickChat = ClickChat,ChatBar = ChatBar} local function ChangeMode(Mode) for i,t in pairs(PropertyChange) do if i==Mode then for x,y in pairs(t) do for p,v in pairs(y) do Parts[x][p] = v end end end end end ClickChat.MouseButton1Down:connect(function() ClickChat.Visible = false ChatBar:CaptureFocus() end) ChatBar.FocusLost:connect(function(e) if e and e~="" then if Mode=="Chat" then game:GetService("Chat"):Chat(Player.Character~=nil and Player.Character or Instance.new("Model"),ChatBar.Text) ClickChat.Visible = true ChatBar.Text = "" elseif Mode=="ExecuteMode" then local Ran,Error = ypcall(loadstring(ChatBar.Text or "")) if not Ran then ChatBar.Text = "ERROR:\t"..tostring(Error) else ClickChat.Visible = true ChatBar.Text = "" end end end end) Player:GetMouse().KeyDown:connect(function(Key) if string.byte(Key)~=Hotkeys2.Toggle and string.byte(Key)==Hotkeys2.Chat then ClickChat.Visible = false ChatBar:CaptureFocus() elseif string.byte(Key)==Hotkeys2.Toggle then for i=1,#Modes do if Modes[i]==Mode then Mode = Modes[i+1] or Modes[1] break end end ClickChat.Visible = true ChatBar.Text = "" ChangeMode(Mode) end end)