Below is a single LocalScript you can drop in StarterPlayer → StarterPlayerScripts (or anywhere that runs on the client).
When the player spawns it builds a lightweight “command-prompt” GUI in their PlayerGui and wires up 20 handy client-side utility commands.
Feel free to tweak UI colours, add/remove commands, or expand the help text to suit your game.
--[[ CommandPrompt.lua ── drop in StarterPlayerScripts
✦ 20 client-side utility commands
✦ Type “help” in the prompt for a full list
]]
-------------------------------------------------------
-- ⌈ Shortcuts ⌋
-------------------------------------------------------
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UIS = game:GetService("UserInputService")
local Lighting = game:GetService("Lighting")
local plr = Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local root = char:WaitForChild("HumanoidRootPart")
-------------------------------------------------------
-- ⌈ GUI Creation ⌋
-------------------------------------------------------
local gui = Instance.new("ScreenGui")
gui.Name = "CommandPrompt"
gui.ResetOnSpawn = false
gui.Parent = plr:WaitForChild("PlayerGui")
local main = Instance.new("Frame")
main.Size = UDim2.new(0.46,0,0,180)
main.Position = UDim2.new(0.5,-(main.Size.X.Offset/2),1,-200)
main.BackgroundColor3 = Color3.fromRGB(20,20,20)
main.BackgroundTransparency = 0.35
main.Parent = gui
Instance.new("UICorner",main)
local output = Instance.new("ScrollingFrame")
output.BackgroundTransparency = 1
output.Size = UDim2.new(1,0,1,-28)
output.CanvasSize = UDim2.new(0,0,1,0)
output.ScrollBarThickness = 6
output.Parent = main
local layout = Instance.new("UIListLayout",output)
layout.Padding = UDim.new(0,4)
layout.SortOrder = Enum.SortOrder.LayoutOrder
local prompt = Instance.new("TextBox")
prompt.Size = UDim2.new(1,0,0,28)
prompt.Position = UDim2.new(0,0,1,-28)
prompt.BackgroundColor3 = Color3.fromRGB(40,40,40)
prompt.TextColor3 = Color3.new(1,1,1)
prompt.ClearTextOnFocus = false
prompt.Font = Enum.Font.Code
prompt.TextXAlignment = Enum.TextXAlignment.Left
prompt.PlaceholderText = " > type a command (help, fly, speed 100 ... )"
prompt.Parent = main
-- helper to print to the log
local function log(t)
local l = Instance.new("TextLabel")
l.BackgroundTransparency = 1
l.Font = Enum.Font.Code
l.TextColor3 = Color3.new(1,1,1)
l.TextXAlignment = Enum.TextXAlignment.Left
l.TextSize = 14
l.Size = UDim2.new(1,0,0,18)
l.Text = tostring(t)
l.Parent = output
output.CanvasSize = UDim2.new(0,0,0,layout.AbsoluteContentSize.Y)
output.CanvasPosition = Vector2.new(0,output.CanvasSize.Y.Offset)
end
-------------------------------------------------------
-- ⌈ Fly / Noclip engines ⌋
-------------------------------------------------------
local flying, noclip = false, false
local flyVel, flyGyro
local flySpeed = 50
local function startFly()
if flying then return end
flying = true
flyGyro = Instance.new("BodyGyro")
flyGyro.P = 9000
flyGyro.MaxTorque = Vector3.new(9e9,9e9,9e9)
flyGyro.CFrame = root.CFrame
flyGyro.Parent = root
flyVel = Instance.new("BodyVelocity")
flyVel.MaxForce = Vector3.new(9e9,9e9,9e9)
flyVel.Velocity = Vector3.zero
flyVel.Parent = root
log("Fly enabled")
end
local function stopFly()
flying = false
if flyVel then flyVel:Destroy() flyVel = nil end
if flyGyro then flyGyro:Destroy() flyGyro = nil end
log("Fly disabled")
end
RunService.RenderStepped:Connect(function()
-- Fly movement
if flying and flyVel and flyGyro then
local camCF = workspace.CurrentCamera.CFrame
flyGyro.CFrame = camCF
local dir = Vector3.zero
if UIS:IsKeyDown(Enum.KeyCode.W) then dir += camCF.LookVector end
if UIS:IsKeyDown(Enum.KeyCode.S) then dir -= camCF.LookVector end
if UIS:IsKeyDown(Enum.KeyCode.A) then dir -= camCF.RightVector end
if UIS:IsKeyDown(Enum.KeyCode.D) then dir += camCF.RightVector end
if UIS:IsKeyDown(Enum.KeyCode.Space) then dir += camCF.UpVector end
if UIS:IsKeyDown(Enum.KeyCode.LeftControl) then dir -= camCF.UpVector end
flyVel.Velocity = dir.Unit * (dir.Magnitude > 0 and flySpeed or 0)
end
-- ensure noclip parts are non-collidable
if noclip and char then
for _,p in ipairs(char:GetDescendants()) do
if p:IsA("BasePart") then p.CanCollide = false end
end
end
end)
-------------------------------------------------------
-- ⌈ 20 Commands ⌋
-------------------------------------------------------
local function runCommand(text)
if text == "" then return end
log("> "..text)
local args = {}
for w in text:gmatch("%S+") do table.insert(args,w) end
local cmd = string.lower(args[1] or "")
local a1,a2,a3 = args[2],args[3],args[4]
-- 1) help
if cmd=="help" then
log("Commands:")
log(" fly / unfly, speed N, jumppower N, gravity N")
log(" noclip / clip, tp USER | tppos X Y Z")
log(" size N, health N, kill, reset, sit, jump,")
log(" dance, time N, chat MESSAGE, clear")
return
end
-- 2) fly
if cmd=="fly" then startFly() return end
-- 3) unfly
if cmd=="unfly" then stopFly() return end
-- 4) speed
if cmd=="speed" or cmd=="walkspeed" then
local n=tonumber(a1) if n then hum.WalkSpeed=n log("WalkSpeed "..n) end
return
end
-- 5) jumppower
if cmd=="jumppower" then
local n=tonumber(a1) if n then hum.JumpPower=n log("JumpPower "..n) end
return
end
-- 6) gravity
if cmd=="gravity" then
local n=tonumber(a1) if n then workspace.Gravity=n log("Gravity "..n) end
return
end
-- 7) noclip
if cmd=="noclip" then noclip=true log("Noclip ON") return end
-- 8) clip
if cmd=="clip" then noclip=false log("Noclip OFF") return end
-- 9) tp <player>
if cmd=="tp" and a1 then
local target=Players:FindFirstChild(a1)
if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") then
root.CFrame = target.Character.HumanoidRootPart.CFrame + Vector3.new(0,3,0)
log("Teleported to "..target.Name)
end
return
end
-- 10) tppos X Y Z
if cmd=="tppos" and a1 and a2 and a3 then
local x,y,z = tonumber(a1),tonumber(a2),tonumber(a3)
if x and y and z then
root.CFrame = CFrame.new(x,y,z)
log("Teleported to ("..x..","..y..","..z..")")
end
return
end
-- 11) size N
if cmd=="size" then
local n = tonumber(a1)
if n then
for _,p in ipairs(char:GetDescendants()) do
if p:IsA("BodyScale") then p.Value = n end
end
log("Scaled character "..n.."×")
end
return
end
-- 12) health N
if cmd=="health" then
local n=tonumber(a1)
if n then hum.MaxHealth=n hum.Health=n log("MaxHealth "..n) end
return
end
-- 13) kill
if cmd=="kill" then hum.Health=0 return end
-- 14) reset (roblox-style respawn)
if cmd=="reset" then hum.Health=0 return end
-- 15) sit
if cmd=="sit" then hum.Sit=true return end
-- 16) jump
if cmd=="jump" then hum.Jump=true return end
-- 17) dance
if cmd=="dance" then
local anim=Instance.new("Animation")
anim.AnimationId="rbxassetid://284353931"
local track=hum:LoadAnimation(anim)
track.Looped=true
track:Play()
log("Dance!")
return
end
-- 18) time N (Lighting.ClockTime)
if cmd=="time" then
local n=tonumber(a1) if n then Lighting.ClockTime=n log("ClockTime "..n) end
return
end
-- 19) chat <message>
if cmd=="chat" then
local msg = text:sub(#cmd+2)
if msg~="" then
game:GetService("ReplicatedStorage")
.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(msg,"All")
end
return
end
-- 20) clear (wipe console)
if cmd=="clear" then
for _,c in ipairs(output:GetChildren()) do
if c:IsA("TextLabel") then c:Destroy() end
end
return
end
log("Unknown command : "..cmd.." (type 'help')")
end
-------------------------------------------------------
-- ⌈ Bind textbox ↦ command handler ⌋
-------------------------------------------------------
prompt.FocusLost:Connect(function(enterPressed)
if enterPressed then
local txt = prompt.Text
prompt.Text = ""
runCommand(txt)
end
end)
log("Command prompt loaded ✔ (type 'help')")
How to use
- Place the script above in StarterPlayer → StarterPlayerScripts (or any client-side container).
- Press Play. A console pops up at the bottom-centre of the screen.
- Click the text box, type commands, and hit Enter.
- Type “help” any time to see the current list of 20 commands.
Enjoy building & testing!