if getgenv().CustomSpeedButtonLoaded then
return
end
getgenv().CustomSpeedButtonLoaded = true
if not game:IsLoaded() then
game.Loaded:Wait()
end
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local ContextActionGui = PlayerGui:WaitForChild("ContextActionGui")
local ContextButtonFrame = ContextActionGui:WaitForChild("ContextButtonFrame")
local OriginalButton = ContextButtonFrame:WaitForChild("ContextActionButton")
task.wait(0.2)
local CustomGui = Instance.new("ScreenGui")
CustomGui.Name = "CustomContextGui"
CustomGui.ResetOnSpawn = false
CustomGui.Parent = PlayerGui
local ClonedButton = OriginalButton:Clone()
ClonedButton.AnchorPoint = Vector2.new(0, 0)
ClonedButton.Position = UDim2.new(0, OriginalButton.AbsolutePosition.X, 0, OriginalButton.AbsolutePosition.Y)
ClonedButton.Size = UDim2.new(0, OriginalButton.AbsoluteSize.X, 0, OriginalButton.AbsoluteSize.Y)
ClonedButton.SizeConstraint = Enum.SizeConstraint.RelativeXY
ClonedButton.Parent = CustomGui
OriginalButton:Destroy()
ContextButtonFrame.ChildAdded:Connect(function(child)
if child.Name == "ContextActionButton" then
task.defer(function()
child:Destroy()
end)
end
end)
local isFast = false
local speedConnection = nil
local function resetState()
isFast = false
if speedConnection then
speedConnection:Disconnect()
speedConnection = nil
end
end
LocalPlayer.CharacterAdded:Connect(resetState)
LocalPlayer:GetPropertyChangedSignal("Team"):Connect(resetState)
ClonedButton.Activated:Connect(function()
local character = LocalPlayer.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
isFast = not isFast
if isFast then
humanoid.WalkSpeed = 24
if speedConnection then
speedConnection:Disconnect()
end
speedConnection = humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
if isFast and humanoid.WalkSpeed == 16 then
humanoid.WalkSpeed = 24
end
end)
else
humanoid.WalkSpeed = 16
resetState()
end
end
end
end)
Comments
Made by ChatGpt, I so lazy