Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local user_input = game:GetService('UserInputService')
- local gui = Instance.new('ScreenGui')
- gui.Parent = plr.PlayerGui
- gui.ResetOnSpawn = false
- local frame = Instance.new('Frame')
- frame.Style = Enum.FrameStyle.DropShadow
- frame.Size = UDim2.new(0.125, 0, 0.05, 0)
- frame.Position = UDim2.new(0, 0, 0.5, 0)
- frame.Parent = gui
- local standard_text = 'Input command.'
- local input = Instance.new('TextBox')
- input.Size = UDim2.new(1, 0, 1, 0)
- input.BackgroundColor3 = Color3.new(0, 0, 0)
- input.BackgroundTransparency = 0.5
- input.TextColor3 = Color3.new(0, 255, 0)
- input.TextScaled = true
- input.Text = standard_text
- input.ClearTextOnFocus = false
- input.TextXAlignment = Enum.TextXAlignment.Left
- input.Font = Enum.Font.SourceSans
- input.Parent = frame
- local working = false
- local stop = false
- function smooth_text(object, text, speed)
- if working == true then
- return
- end
- object.Text = ''
- working = true
- for i = 1, #text, 1 do
- if stop then
- break
- end
- object.Text = object.Text .. string.sub(text, i, i)
- wait(speed)
- end
- stop = false
- working = false
- end
- local working_second = false
- local stop_second = false
- function smooth_clear(object, speed)
- if working_second == true then
- return
- end
- working_second = true
- local working_text = object.Text
- for i = #working_text, 0, -1 do
- if stop_second == true then
- break
- end
- object.Text = string.sub(working_text, 1, i)
- wait(speed)
- end
- stop_second = false
- working_second = false
- end
- function get_first_argument(raw)
- if string.find(raw, ' ') then
- return string.sub(raw, 1, string.find(raw, ' ') - 1)
- else
- return nil
- end
- end
- function get_arguments(raw, divider)
- local arguments = {}
- while get_first_argument(raw) ~= nil do
- arguments[#arguments + 1] = get_first_argument(raw)
- raw = string.sub(raw, string.find(raw, ' ') + 1)
- end
- arguments[#arguments + 1] = raw
- return arguments
- end
- function valid(arguments, one)
- if arguments == nil then
- return false
- else
- if one == true then
- if #arguments > 1 then
- return false
- end
- end
- end
- return true
- end
- local commands = {
- ['cmds'] = {
- ['additional'] = {'cmd', 'help'},
- ['description'] = 'Shows help.'
- },
- ['hipheight'] = {
- ['additional'] = {'hh'},
- ['description'] = 'Changes your hipheight.'
- },
- ['gaf'] = {
- ['game'] = 'steve\'s one piece',
- ['additional'] = {'gaf'},
- ['description'] = 'Teleports all tools to you.'
- },
- ['print'] = {
- ['description'] = 'Prints your arguments.'
- },
- ['walkspeed'] = {
- ['additional'] = {'ws', 'speed'},
- ['description'] = 'Changes your walkspeed.'
- }
- }
- local current = 0
- local frame = Instance.new('ScrollingFrame')
- frame.Visible = false
- frame.Size = UDim2.new(0.4, 0, 0.4, 0)
- frame.Position = UDim2.new(0.13, 0, 0.5, 0)
- frame.BackgroundColor3 = Color3.new(0, 0, 0)
- frame.BackgroundTransparency = 0.5
- frame.Parent = gui
- for k, v in pairs(commands) do
- local text_label = Instance.new('TextLabel')
- text_label.Size = UDim2.new(0.25, 0, 0.025, 0)
- text_label.Position = UDim2.new(0, 0, current)
- text_label.BackgroundColor3 = Color3.new(0, 0, 0)
- text_label.BackgroundTransparency = 0.5
- text_label.TextColor3 = Color3.new(0, 255, 0)
- text_label.TextScaled = true
- text_label.Text = k
- text_label.Font = Enum.Font.SourceSans
- text_label.Parent = frame
- local text_description = text_label:Clone()
- text_description.Text = v['description']
- text_description.Size = text_description.Size + UDim2.new(0.5, 0, 0, 0)
- text_description.Position = text_description.Position + UDim2.new(0.25, 0, 0, 0)
- text_description.Parent = frame
- current = current + 0.026
- end
- local close = Instance.new('TextButton')
- close.Visible = false
- close.Size = UDim2.new(0.03, 0, 0.03, 0)
- close.Position = UDim2.new(0.54, 0, 0.5, 0)
- close.BackgroundColor3 = Color3.new(255, 0, 0)
- close.BackgroundTransparency = 0.5
- close.Text = 'X'
- close.TextColor3 = Color3.new(255, 255, 255)
- close.TextScaled = true
- close.Parent = gui
- close.MouseButton1Click:Connect(function()
- frame.Visible = false
- close.Visible = false
- end)
- local showed = false
- function show_help()
- if frame.Visible == false then
- close.Visible = true
- frame.Visible = true
- else
- close.Visible = false
- frame.Visible = false
- end
- end
- function process_command(raw)
- local raw = string.lower(raw)
- local arguments = get_arguments(raw, ' ')
- local command = nil
- if arguments ~= nil then
- command = arguments[1]
- table.remove(arguments, 1)
- else
- command = raw
- end
- if command == 'cmds' or command == 'cmd' or command == 'help' then
- show_help()
- end
- if command == 'print' then
- local to_print = table.concat(arguments, ' ')
- print(to_print)
- end
- if command == 'hipheight' or command == 'hh' then
- if valid(arguments, true) then
- if game.Workspace:FindFirstChild(plr.Name) then
- plr.Character.Humanoid.HipHeight = tonumber(arguments[1])
- end
- end
- end
- if command == 'walkspeed' or command == 'ws' then
- if valid(arguments, true) then
- if game.Workspace:FindFirstChild(plr.Name) then
- plr.Character.Humanoid.WalkSpeed = tonumber(arguments[1])
- end
- end
- end
- if command == 'getallfruits' or command == 'gaf' then
- for _, v in pairs(game.Workspace:GetChildren()) do
- if v.ClassName == 'Tool' then
- if v:FindFirstChild('Handle') then
- local m = Instance.new('Model')
- m.Parent = game.Workspace
- v.Parent = m
- m:MoveTo(plr.Character.Head.Position)
- end
- end
- end
- end
- end
- input.Focused:Connect(function()
- if working == true then
- stop = true
- smooth_clear(input, 0.001)
- else
- smooth_clear(input, 0.001)
- end
- end)
- input.FocusLost:Connect(function()
- smooth_text(input, standard_text, 0.001)
- end)
- user_input.InputBegan:Connect(function(input_object)
- if input_object.KeyCode == Enum.KeyCode.Semicolon then
- if input:IsFocused() then
- if input.Text ~= standard_text then
- if input.Text ~= nil then
- process_command(input.Text)
- end
- input:ReleaseFocus()
- end
- else
- input:CaptureFocus()
- end
- else
- if working_second == true then
- input.Text = ''
- stop_second = true
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement