Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Speed Hub Script for Executors (Delta, Synapse, etc.)
- -- Get the player and character
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- -- Default speed value and stages
- local speedStages = {16, 32, 64, 128} -- Defining 4 stages: normal, little faster, fast, faster
- local currentSpeedIndex = 1 -- Start at normal speed (index 1)
- -- Function to update speed based on the current stage
- local function updateSpeed()
- humanoid.WalkSpeed = speedStages[currentSpeedIndex]
- end
- -- Function to create the GUI
- local function createGUI()
- -- Create ScreenGui
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = player.PlayerGui
- -- Create the Speed Hub Frame (smaller size)
- local hubFrame = Instance.new("Frame")
- hubFrame.Size = UDim2.new(0, 200, 0, 150) -- Smaller size
- hubFrame.Position = UDim2.new(0, 50, 0, 50)
- hubFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- hubFrame.Visible = true -- Ensure it starts as visible
- hubFrame.Parent = screenGui
- -- Make the hub frame draggable
- local dragging = false
- local dragInput, dragStart, startPos
- -- Update the position of the frame as it is being dragged
- local function updateDrag(input)
- local delta = input.Position - dragStart
- hubFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- -- Listen for when the drag starts
- hubFrame.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = hubFrame.Position
- input.Changed:Connect(function()
- if dragging then
- updateDrag(input)
- end
- end)
- end
- end)
- -- Listen for when the drag ends
- hubFrame.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = false
- end
- end)
- -- Create the Increase Speed Button
- local increaseButton = Instance.new("TextButton")
- increaseButton.Size = UDim2.new(0, 150, 0, 40)
- increaseButton.Position = UDim2.new(0, 25, 0, 30)
- increaseButton.Text = "Increase Speed"
- increaseButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0) -- Green button
- increaseButton.Parent = hubFrame
- -- Create the Decrease Speed Button
- local decreaseButton = Instance.new("TextButton")
- decreaseButton.Size = UDim2.new(0, 150, 0, 40)
- decreaseButton.Position = UDim2.new(0, 25, 0, 80)
- decreaseButton.Text = "Decrease Speed"
- decreaseButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0) -- Red button
- decreaseButton.Parent = hubFrame
- -- Create the Hub Toggle Button (Initially for closing the hub)
- local toggleButton = Instance.new("TextButton")
- toggleButton.Size = UDim2.new(0, 150, 0, 40)
- toggleButton.Position = UDim2.new(0, 25, 0, 120)
- toggleButton.Text = "Close Hub"
- toggleButton.BackgroundColor3 = Color3.fromRGB(0, 0, 255) -- Blue button
- toggleButton.Parent = hubFrame
- -- Button click functions to adjust speed
- increaseButton.MouseButton1Click:Connect(function()
- -- Move to next speed stage if it's not at the last speed
- if currentSpeedIndex < #speedStages then
- currentSpeedIndex = currentSpeedIndex + 1
- end
- updateSpeed()
- end)
- decreaseButton.MouseButton1Click:Connect(function()
- -- Move to previous speed stage if it's not at the first speed
- if currentSpeedIndex > 1 then
- currentSpeedIndex = currentSpeedIndex - 1
- end
- updateSpeed()
- end)
- -- Toggle the visibility of the hub (to close the hub)
- toggleButton.MouseButton1Click:Connect(function()
- hubFrame.Visible = false -- Hide the hub when clicking Close
- reopenButton.Visible = true -- Show the Reopen Hub button
- end)
- -- Create the Reopen Hub Button (visible only after closing the hub)
- local reopenButton = Instance.new("TextButton")
- reopenButton.Size = UDim2.new(0, 150, 0, 40)
- reopenButton.Position = UDim2.new(0, 25, 0, 50)
- reopenButton.Text = "Reopen Hub"
- reopenButton.BackgroundColor3 = Color3.fromRGB(0, 255, 255) -- Cyan button
- reopenButton.Visible = false -- Initially hidden
- reopenButton.Parent = screenGui
- -- Button to reopen the hub
- reopenButton.MouseButton1Click:Connect(function()
- hubFrame.Visible = true -- Show the hub again
- reopenButton.Visible = false -- Hide the Reopen Hub button
- end)
- end
- -- Initial setup
- createGUI()
- updateSpeed()
- -- Listen for respawn to reset speed
- player.CharacterAdded:Connect(function(newCharacter)
- character = newCharacter
- humanoid = character:WaitForChild("Humanoid")
- updateSpeed()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement