-- Assuming 'owner' is a valid player object
local player = owner
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local copiedObject = nil
-- Create ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "UtilityGUI"
screenGui.Parent = player:WaitForChild("PlayerGui")
-- Create Frame
local frame = Instance.new("Frame", screenGui)
frame.Size = UDim2.new(0, 300, 0, 400)
frame.Position = UDim2.new(0, 10, 0, 10)
frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
frame.BorderSizePixel = 0
-- Create Jump Height TextBox
local jumpHeightTextBox = Instance.new("TextBox", frame)
jumpHeightTextBox.PlaceholderText = "Enter Jump Height"
jumpHeightTextBox.Size = UDim2.new(0, 280, 0, 50)
jumpHeightTextBox.Position = UDim2.new(0, 10, 0, 10)
jumpHeightTextBox.Text = ""
jumpHeightTextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
-- Create Jump Height Button
local jumpHeightButton = Instance.new("TextButton", frame)
jumpHeightButton.Size = UDim2.new(0, 280, 0, 50)
jumpHeightButton.Position = UDim2.new(0, 10, 0, 70)
jumpHeightButton.Text = "Set Jump Height"
jumpHeightButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
jumpHeightButton.MouseButton1Click:Connect(function()
local height = tonumber(jumpHeightTextBox.Text)
if height then
humanoid.JumpPower = height
print("Jump height set to", height)
else
print("Invalid jump height")
end
end)
-- Create Walk Speed TextBox
local walkSpeedTextBox = Instance.new("TextBox", frame)
walkSpeedTextBox.PlaceholderText = "Enter Walk Speed"
walkSpeedTextBox.Size = UDim2.new(0, 280, 0, 50)
walkSpeedTextBox.Position = UDim2.new(0, 10, 0, 130)
walkSpeedTextBox.Text = ""
walkSpeedTextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
-- Create Walk Speed Button
local walkSpeedButton = Instance.new("TextButton", frame)
walkSpeedButton.Size = UDim2.new(0, 280, 0, 50)
walkSpeedButton.Position = UDim2.new(0, 10, 0, 190)
walkSpeedButton.Text = "Set Walk Speed"
walkSpeedButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
walkSpeedButton.MouseButton1Click:Connect(function()
local speed = tonumber(walkSpeedTextBox.Text)
if speed then
humanoid.WalkSpeed = speed
print("Walk speed set to", speed)
else
print("Invalid walk speed")
end
end)
-- Create Lua Execute TextBox
local luaExecuteTextBox = Instance.new("TextBox", frame)
luaExecuteTextBox.PlaceholderText = "Enter Lua Code"
luaExecuteTextBox.Size = UDim2.new(0, 280, 0, 50)
luaExecuteTextBox.Position = UDim2.new(0, 10, 0, 250)
luaExecuteTextBox.Text = ""
luaExecuteTextBox.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
luaExecuteTextBox.MultiLine = true
-- Create Lua Execute Button
local luaExecuteButton = Instance.new("TextButton", frame)
luaExecuteButton.Size = UDim2.new(0, 280, 0, 50)
luaExecuteButton.Position = UDim2.new(0, 10, 0, 310)
luaExecuteButton.Text = "Execute Lua"
luaExecuteButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
luaExecuteButton.MouseButton1Click:Connect(function()
local code = luaExecuteTextBox.Text
local func, err = loadstring(code)
if func then
func()
else
warn(err)
end
end)
-- Create File Explorer Button
local fileExplorerButton = Instance.new("TextButton", frame)
fileExplorerButton.Size = UDim2.new(0, 280, 0, 50)
fileExplorerButton.Position = UDim2.new(0, 10, 0, 370)
fileExplorerButton.Text = "Explore Files"
fileExplorerButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
fileExplorerButton.MouseButton1Click:Connect(function()
local explorerFrame = Instance.new("Frame", screenGui)
explorerFrame.Size = UDim2.new(0, 300, 0, 300)
explorerFrame.Position = UDim2.new(0, 320, 0, 10)
explorerFrame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
explorerFrame.BorderSizePixel = 0
local scrollingFrame = Instance.new("ScrollingFrame", explorerFrame)
scrollingFrame.Size = UDim2.new(1, -20, 1, -120)
scrollingFrame.Position = UDim2.new(0, 10, 0, 10)
scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
scrollingFrame.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
scrollingFrame.BorderSizePixel = 0
local uiListLayout = Instance.new("UIListLayout", scrollingFrame)
uiListLayout.Padding = UDim.new(0, 5)
uiListLayout.FillDirection = Enum.FillDirection.Vertical
uiListLayout.SortOrder = Enum.SortOrder.LayoutOrder
local closeButton = Instance.new("TextButton", explorerFrame)
closeButton.Size = UDim2.new(1, -20, 0, 50)
closeButton.Position = UDim2.new(0, 10, 1, -50)
closeButton.Text = "Close"
closeButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
closeButton.MouseButton1Click:Connect(function()
explorerFrame:Destroy()
end)
local addButton = Instance.new("TextButton", explorerFrame)
addButton.Size = UDim2.new(1, -20, 0, 50)
addButton.Position = UDim2.new(0, 10, 1, -110)
addButton.Text = "Add Object"
addButton.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
addButton.MouseButton1Click:Connect(function()
local newObject = Instance.new("Part", game.Workspace)
newObject.Name = "NewPart"
updateExplorer()
end)
local function createContextMenu(parent, object)
local contextMenu = Instance.new("Frame", parent)
contextMenu.Size = UDim2.new(0, 100, 0, 150)
contextMenu.BackgroundColor3 = Color3.fromRGB(100, 100, 100)
contextMenu.Visible = false
local cloneButton = Instance.new("TextButton", contextMenu)
cloneButton.Size = UDim2.new(1, 0, 0, 30)
cloneButton.Position = UDim2.new(0, 0, 0, 0)
cloneButton.Text = "Clone"
cloneButton.MouseButton1Click:Connect(function()
object:Clone().Parent = object.Parent
updateExplorer()
end)
local deleteButton = Instance.new("TextButton", contextMenu)
deleteButton.Size = UDim2.new(1, 0, 0, 30)
deleteButton.Position = UDim2.new(0, 0, 0, 30)
deleteButton.Text = "Delete"
deleteButton.MouseButton1Click:Connect(function()
object:Destroy()
updateExplorer()
end)
local copyButton = Instance.new("TextButton", contextMenu)
copyButton.Size = UDim2.new(1, 0, 0, 30)
copyButton.Position = UDim2.new(0, 0, 0, 60)
copyButton.Text = "Copy"
copyButton.MouseButton1Click:Connect(function()
copiedObject = object
end)
local pasteButton = Instance.new("TextButton", contextMenu)
pasteButton.Size = UDim2.new(1, 0, 0, 30)
pasteButton.Position = UDim2.new(0, 0, 0, 90)
pasteButton.Text = "Paste"
pasteButton.MouseButton1Click:Connect(function()
if copiedObject then
copiedObject:Clone().Parent = object.Parent
updateExplorer()
end
end)
return contextMenu
end
local function updateExplorer()
-- Clear existing contents of the scrolling frame
for _, child in ipairs(scrollingFrame:GetChildren()) do
child:Destroy()
end
-- Re-populate the scrolling frame with new objects (if needed)
local workspaceChildren = game.Workspace:GetChildren()
for i, child in ipairs(workspaceChildren) do
local itemButton = Instance.new("TextButton", scrollingFrame)
itemButton.Size = UDim2.new(1, -20, 0, 50)
itemButton.Position = UDim2.new