Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------
- -- Feel free to use samples of this or the whole thing, idc.
- local create = LoadLibrary("RbxUtility").Create; -- Instance.new utility
- local gp = UDim.new; local gp2 = UDim2.new; local c3 = Color3.new; -- Saves typing
- local function c255(r,g,b) return c3(r/255, g/255, b/255) end;
- local me = game.Players.LocalPlayer;
- local mouse = me:GetMouse();
- local commandBarHotkey = ";";
- -----------------------------------------------------
- local cmdbarlasttext = "Command Bar";
- local function MakeGuis()
- local cmdbarexecuted = true;
- local gui = me.PlayerGui:FindFirstChild("gui") or create "ScreenGui" {
- Parent = me.PlayerGui;
- Name = "gui";
- };
- local cmdBarFrame = gui:FindFirstChild("Cmd_Bar") or create "Frame" {
- Parent = gui;
- Name = "Cmd_Bar";
- Position = gp2(1, -300, 1, -100);
- Size = gp2(0, 300, 0, -35);
- Style = Enum.FrameStyle.DropShadow;
- ZIndex = 9;
- };
- local cmdBar = cmdBarFrame:FindFirstChild("TB") or create "TextBox" {
- Parent = cmdBarFrame;
- Name = "TB";
- BackgroundTransparency = 1;
- ClearTextOnFocus = false;
- MultiLine = false;
- Position = gp2(0, 0, 0, 0);
- Size = gp2(1, -6, 1, 0);
- ZIndex = 10;
- Font = Enum.Font.SourceSans;
- FontSize = Enum.FontSize.Size24;
- Text = cmdbarlasttext;
- TextColor3 = c3(1, 1, 1);
- TextScaled = false;
- TextWrapped = false;
- TextStrokeColor3 = c255(170, 170, 170);
- TextStrokeTransparency = 0.7;
- TextXAlignment = Enum.TextXAlignment.Right;
- };
- cmdBar.FocusLost:connect(function(enterPressed)
- if (enterPressed) then
- local txt = cmdBar.Text
- --------------------------------------
- --CODE WHEN ENTER IS PRESSED HERE ;)
- --onChat(txt);
- print(string.format("Command bar executed! (%q)", txt))
- --------------------------------------
- cmdbarexecuted = true;
- end
- end)
- cmdBar.Changed:connect(function(change)
- if (change ~= "Parent") then
- cmdbarlasttext = cmdBar.Text;
- end
- end)
- mouse.KeyDown:connect(function(key)
- if (key == commandBarHotkey) then
- if (cmdbarexecuted == true) then
- cmdBar.Text = "";
- cmdbarexecuted = false;
- end
- cmdBar:CaptureFocus();
- end
- end)
- return gui;
- end
- MakeGuis()
- -- roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox roblox
Advertisement
Add Comment
Please, Sign In to add comment