-- LocalScript inside StarterPlayerScripts
-- Hydra Hub Script
local hubName = "Hydra Hub"
print(hubName .. " script initialized.")
local player = game.Players.LocalPlayer
local originalSpeed = 16 -- Default walking speed
local boostedSpeed = 50 -- Speed after boost
local speedBoostActive = false
-- Create a ScreenGui to display the UI
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = player.PlayerGui
-- Create a UI button to toggle speed
local speedButton = Instance.new("TextButton")
speedButton.Text = "Toggle Speed"
speedButton.Size = UDim2.new(0, 200, 0, 50) -- Size of the button
speedButton.Position = UDim2.new(0.5, -100, 0.9, -25) -- Position it at the bottom center
speedButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0) -- Green button
speedButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- White text
speedButton.Font = Enum.Font.SourceSans
speedButton.TextSize = 24
speedButton.Parent = screenGui
-- Create a text label for showing the hub's name
local hubLabel = Instance.new("TextLabel")
hubLabel.Text = hubName -- Display the hub name
hubLabel.Size = UDim2.new(0, 300, 0, 50)
hubLabel.Position = UDim2.new(0.5, -150, 0.1, 0) -- Position at the top center
hubLabel.BackgroundTransparency = 1
hubLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
hubLabel.Font = Enum.Font.SourceSansBold
hubLabel.TextSize = 30
hubLabel.Parent = screenGui
-- Wait for the player's character to load and set the initial speed
local function onCharacterAdded(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.WalkSpeed = originalSpeed -- Set to the original speed initially
-- Function to toggle speed when the button is clicked
speedButton.MouseButton1Click:Connect(function()
if speedBoostActive then
-- Deactivate speed boost
humanoid.WalkSpeed = originalSpeed
speedBoostActive = false
else
-- Activate speed boost
humanoid.WalkSpeed = boostedSpeed
speedBoostActive = true
end
end)
end
-- Listen for when the player's character is added to the game
player.CharacterAdded:Connect(onCharacterAdded)
-- If the character is already in the game, apply the script immediately
if player.Character then
onCharacterAdded(player.Character)
end
To embed this project on your website, copy the following code and paste it into your website's HTML: