
KeylessUniversal

--[[
š Auto Speed Tool Script
This script automatically creates a Tool named "Speed" in the player's backpack.
When equipped, the player's WalkSpeed becomes 56.
When unequipped, the speed returns to normal.
]]
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
--// Tool Settings
local TOOL_NAME = "Speed"
local SPEED_WHILE_HELD = 56
--// Create the tool
local SpeedTool = Instance.new("Tool")
SpeedTool.Name = TOOL_NAME
SpeedTool.RequiresHandle = false -- No need for a part/handle
SpeedTool.CanBeDropped = false
SpeedTool.Parent = LocalPlayer:WaitForChild("Backpack")
--// Variables
local humanoid
local defaultSpeed = 16
--// Functions
local function getHumanoid()
local character = LocalPlayer.Character
if not character then return nil end
return character:FindFirstChildOfClass("Humanoid")
end
local function applySpeedBoost()
humanoid = getHumanoid()
if humanoid then
defaultSpeed = humanoid.WalkSpeed
humanoid.WalkSpeed = SPEED_WHILE_HELD
end
end
local function resetSpeed()
humanoid = getHumanoid()
if humanoid then
humanoid.WalkSpeed = defaultSpeed
end
end
--// Tool Events
SpeedTool.Equipped:Connect(function()
applySpeedBoost()
end)
SpeedTool.Unequipped:Connect(function()
resetSpeed()
end)
--// Player Respawn Handling
LocalPlayer.CharacterAdded:Connect(function(character)
local newHumanoid = character:WaitForChild("Humanoid")
defaultSpeed = newHumanoid.WalkSpeed
end)
--// Initialize (for already spawned characters)
if LocalPlayer.Character then
local hum = LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
if hum then
defaultSpeed = hum.WalkSpeed
end
end
āNo comments yet for this script.



