Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- LocalScript in StarterGui
- local player = game.Players.LocalPlayer
- local RunService = game:GetService("RunService")
- local Players = game:GetService("Players")
- local Workspace = game:GetService("Workspace")
- local Camera = workspace.CurrentCamera
- -- Default Values
- local speed = 16
- local jumpPower = 50
- local noclipEnabled = false
- local spinSpeed = 0
- local loopTP = false
- local loopTarget = nil -- Added to store the loop TP target
- -- Helpers
- local function createLabel(parent, text, posY)
- local label = Instance.new("TextLabel")
- label.Size = UDim2.new(0, 165, 0, 22)
- label.Position = UDim2.new(0, 7, 0, posY)
- label.BackgroundTransparency = 1
- label.TextColor3 = Color3.fromRGB(255,255,255)
- label.Text = text
- label.Parent = parent
- return label
- end
- local function createBox(parent, posY, placeholder, default, width)
- local box = Instance.new("TextBox")
- box.Size = UDim2.new(0, width or 165, 0, 22)
- box.Position = UDim2.new(0, 7, 0, posY)
- box.PlaceholderText = placeholder
- box.Text = tostring(default)
- box.ClearTextOnFocus = false
- box.Parent = parent
- return box
- end
- local function createButton(parent, posY, text)
- local btn = Instance.new("TextButton")
- btn.Size = UDim2.new(0, 165, 0, 30)
- btn.Position = UDim2.new(0, 7, 0, posY)
- btn.Text = text
- btn.BackgroundColor3 = Color3.fromRGB(70,70,70)
- btn.TextColor3 = Color3.fromRGB(255,255,255)
- btn.Parent = parent
- return btn
- end
- -- Main GUI
- local function setupGUI(character)
- local humanoid = character:WaitForChild("Humanoid")
- local hrp = character:WaitForChild("HumanoidRootPart")
- humanoid.WalkSpeed = speed
- humanoid.JumpPower = jumpPower
- local existingGui = player:FindFirstChild("PlayerGui"):FindFirstChild("AdminGUI")
- if existingGui then existingGui:Destroy() end
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "AdminGUI"
- screenGui.ResetOnSpawn = false
- screenGui.Parent = player:WaitForChild("PlayerGui")
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 200, 0, 560)
- frame.Position = UDim2.new(0.5, -100, 0.1, 0)
- frame.BackgroundColor3 = Color3.fromRGB(25,25,25)
- frame.BorderSizePixel = 0
- frame.Active = true
- frame.Draggable = true
- frame.Parent = screenGui
- local title = Instance.new("TextLabel")
- title.Size = UDim2.new(1,0,0,25)
- title.Position = UDim2.new(0,0,0,0)
- title.BackgroundColor3 = Color3.fromRGB(50,50,50)
- title.Text = "Admin GUI"
- title.TextColor3 = Color3.fromRGB(255,255,255)
- title.Font = Enum.Font.SourceSansBold
- title.TextScaled = true
- title.Parent = frame
- local minimized = false
- local minimizeBtn = Instance.new("TextButton")
- minimizeBtn.Size = UDim2.new(0,22,0,22)
- minimizeBtn.Position = UDim2.new(1,-26,0,0)
- minimizeBtn.Text = "-"
- minimizeBtn.TextColor3 = Color3.fromRGB(255,255,255)
- minimizeBtn.BackgroundColor3 = Color3.fromRGB(100,100,100)
- minimizeBtn.Font = Enum.Font.SourceSansBold
- minimizeBtn.TextScaled = true
- minimizeBtn.Parent = frame
- minimizeBtn.MouseButton1Click:Connect(function()
- minimized = not minimized
- for _, child in pairs(frame:GetChildren()) do
- if child ~= title and child ~= minimizeBtn then
- child.Visible = not minimized
- end
- end
- frame.Size = minimized and UDim2.new(0,200,0,25) or UDim2.new(0,200,0,560)
- minimizeBtn.Text = minimized and "+" or "-"
- end)
- local y = 30
- -- Speed
- local speedLabel = createLabel(frame, "Speed: "..speed, y); y+=26
- local speedBox = createBox(frame, y,"Set Speed",speed); y+=30
- speedBox.FocusLost:Connect(function()
- local val = tonumber(speedBox.Text)
- if val and val>0 then speed=val humanoid.WalkSpeed=speed speedLabel.Text="Speed: "..speed else speedBox.Text=tostring(speed) end
- end)
- -- Jump
- local jumpLabel = createLabel(frame,"Jump Power: "..jumpPower,y); y+=26
- local jumpBox = createBox(frame,y,"Set Jump Power",jumpPower); y+=30
- jumpBox.FocusLost:Connect(function()
- local val = tonumber(jumpBox.Text)
- if val and val>0 then jumpPower=val humanoid.JumpPower=jumpPower jumpLabel.Text="Jump Power: "..jumpPower else jumpBox.Text=tostring(jumpPower) end
- end)
- -- Noclip
- local noclipBtn = createButton(frame, y,"Noclip: Off"); y+=38
- noclipBtn.MouseButton1Click:Connect(function()
- noclipEnabled = not noclipEnabled
- if noclipEnabled then
- noclipBtn.Text = "Noclip: On"
- else
- noclipBtn.Text = "Noclip: Off"
- end
- end)
- -- Spin
- local spinLabel = createLabel(frame,"Spin Speed: "..spinSpeed,y); y+=22
- local spinBox = createBox(frame,y,"0-1000",spinSpeed); y+=30
- spinBox.FocusLost:Connect(function()
- local val = tonumber(spinBox.Text)
- if val and val>=0 and val<=1000 then
- spinSpeed = val
- spinLabel.Text = "Spin Speed: "..spinSpeed
- else
- spinBox.Text = tostring(spinSpeed)
- end
- end)
- -- Teleport
- local tpBox = createBox(frame,y,"Name/Display/.random",""); y+=30
- local tpBtn = createButton(frame,y,"Teleport"); y+=38
- tpBtn.MouseButton1Click:Connect(function()
- local input = tpBox.Text:lower()
- local target=nil
- if input==".random" then
- local all={}
- for _,p in pairs(Players:GetPlayers()) do
- if p~=player then table.insert(all,p) end
- end
- if #all>0 then target=all[math.random(1,#all)] end
- else
- for _,p in pairs(Players:GetPlayers()) do
- if p.Name:lower()==input or p.DisplayName:lower()==input then
- target=p
- break
- end
- end
- end
- if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") then
- local hrp = character:FindFirstChild("HumanoidRootPart")
- hrp.CFrame = target.Character.HumanoidRootPart.CFrame + Vector3.new(0,3,0)
- end
- end)
- -- Loop TP
- local loopTPBtn = createButton(frame,y,"Loop TP: Off"); y+=38
- loopTPBtn.MouseButton1Click:Connect(function()
- local input = tpBox.Text
- if not input then
- loopTarget = nil
- loopTP = false
- loopTPBtn.Text = "Loop TP: Off"
- return
- end
- input = input:lower()
- if input == "" then
- loopTarget = nil
- loopTP = false
- loopTPBtn.Text = "Loop TP: Off"
- return
- end
- if input == ".random" then
- local all={}
- for _,p in pairs(Players:GetPlayers()) do
- if p~=player then table.insert(all,p) end
- end
- if #all>0 then
- loopTarget = all[math.random(1,#all)]
- else
- loopTarget = nil
- end
- else
- loopTarget = nil
- for _,p in pairs(Players:GetPlayers()) do
- if p.Name:lower() == input or p.DisplayName:lower() == input then
- loopTarget = p
- break
- end
- end
- end
- loopTP = loopTarget ~= nil
- loopTPBtn.Text = loopTP and "Loop TP: On" or "Loop TP: Off"
- end)
- end
- -- RunService loop
- RunService.Heartbeat:Connect(function()
- local character = player.Character
- if not character then return end
- local hrp = character:FindFirstChild("HumanoidRootPart")
- local humanoid = character:FindFirstChild("Humanoid")
- if not hrp or not humanoid then return end
- -- Noclip
- if noclipEnabled then
- for _,part in pairs(character:GetDescendants()) do
- if part:IsA("BasePart") then
- part.CanCollide = false
- end
- end
- else
- for _,part in pairs(character:GetDescendants()) do
- if part:IsA("BasePart") then
- part.CanCollide = true
- end
- end
- end
- -- Spin
- if spinSpeed > 0 then
- hrp.CFrame = hrp.CFrame * CFrame.Angles(0, math.rad(spinSpeed / 10), 0)
- end
- -- Loop TP
- if loopTP and loopTarget and loopTarget.Character and loopTarget.Character:FindFirstChild("HumanoidRootPart") then
- hrp.CFrame = loopTarget.Character.HumanoidRootPart.CFrame + Vector3.new(0,3,0)
- end
- --Speed
- humanoid.WalkSpeed = speed
- humanoid.JumpPower = jumpPower
- end)
- -- Initialize GUI on character spawn
- player.CharacterAdded:Connect(function(char)
- setupGUI(char)
- end)
- if player.Character then
- setupGUI(player.Character)
- end
Advertisement
Add Comment
Please, Sign In to add comment