Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local walkSpeedToggle = false
- local HumanModCons = {}
- local walkSpeedButton = Instance.new("TextButton")
- walkSpeedButton.Size = UDim2.new(0, 220, 0, 50)
- walkSpeedButton.Position = UDim2.new(0.5, -110, 0.2, 0)
- walkSpeedButton.BackgroundColor3 = Color3.fromRGB(70, 130, 255)
- walkSpeedButton.Text = "WalkSpeed: OFF"
- walkSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- walkSpeedButton.Font = Enum.Font.GothamBold
- walkSpeedButton.TextSize = 16
- walkSpeedButton.Parent = miscPage
- Instance.new("UICorner", walkSpeedButton).CornerRadius = UDim.new(0, 8)
- local function setWalkSpeed(speed)
- if typeof(speed) == "number" then
- local Char = player.Character or workspace:FindFirstChild(player.Name)
- local Human = Char and Char:FindFirstChildWhichIsA("Humanoid")
- local function WalkSpeedChange()
- if Char and Human then
- Human.WalkSpeed = speed
- end
- end
- WalkSpeedChange()
- if HumanModCons.wsLoop then
- HumanModCons.wsLoop:Disconnect()
- end
- if HumanModCons.wsCA then
- HumanModCons.wsCA:Disconnect()
- end
- if Human then
- HumanModCons.wsLoop = Human:GetPropertyChangedSignal("WalkSpeed"):Connect(WalkSpeedChange)
- end
- HumanModCons.wsCA = player.CharacterAdded:Connect(function(nChar)
- Char, Human = nChar, nChar:WaitForChild("Humanoid")
- WalkSpeedChange()
- HumanModCons.wsLoop = Human:GetPropertyChangedSignal("WalkSpeed"):Connect(WalkSpeedChange)
- end)
- end
- end
- walkSpeedButton.MouseButton1Click:Connect(function()
- walkSpeedToggle = not walkSpeedToggle
- if walkSpeedToggle then
- walkSpeedButton.Text = "WalkSpeed: ON (50)"
- walkSpeedButton.BackgroundColor3 = Color3.fromRGB(0, 200, 100)
- setWalkSpeed(50)
- else
- walkSpeedButton.Text = "WalkSpeed: OFF"
- walkSpeedButton.BackgroundColor3 = Color3.fromRGB(70, 130, 255)
- setWalkSpeed(16)
- if HumanModCons.wsLoop then
- HumanModCons.wsLoop:Disconnect()
- HumanModCons.wsLoop = nil
- end
- if HumanModCons.wsCA then
- HumanModCons.wsCA:Disconnect()
- HumanModCons.wsCA = nil
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment