iOSdeveloper

Untitled

Jun 23rd, 2025
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. local walkSpeedToggle = false
  2. local HumanModCons = {}
  3.  
  4. local walkSpeedButton = Instance.new("TextButton")
  5. walkSpeedButton.Size = UDim2.new(0, 220, 0, 50)
  6. walkSpeedButton.Position = UDim2.new(0.5, -110, 0.2, 0)
  7. walkSpeedButton.BackgroundColor3 = Color3.fromRGB(70, 130, 255)
  8. walkSpeedButton.Text = "WalkSpeed: OFF"
  9. walkSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  10. walkSpeedButton.Font = Enum.Font.GothamBold
  11. walkSpeedButton.TextSize = 16
  12. walkSpeedButton.Parent = miscPage
  13. Instance.new("UICorner", walkSpeedButton).CornerRadius = UDim.new(0, 8)
  14.  
  15. local function setWalkSpeed(speed)
  16. if typeof(speed) == "number" then
  17. local Char = player.Character or workspace:FindFirstChild(player.Name)
  18. local Human = Char and Char:FindFirstChildWhichIsA("Humanoid")
  19.  
  20. local function WalkSpeedChange()
  21. if Char and Human then
  22. Human.WalkSpeed = speed
  23. end
  24. end
  25.  
  26. WalkSpeedChange()
  27.  
  28. if HumanModCons.wsLoop then
  29. HumanModCons.wsLoop:Disconnect()
  30. end
  31. if HumanModCons.wsCA then
  32. HumanModCons.wsCA:Disconnect()
  33. end
  34.  
  35. if Human then
  36. HumanModCons.wsLoop = Human:GetPropertyChangedSignal("WalkSpeed"):Connect(WalkSpeedChange)
  37. end
  38.  
  39. HumanModCons.wsCA = player.CharacterAdded:Connect(function(nChar)
  40. Char, Human = nChar, nChar:WaitForChild("Humanoid")
  41. WalkSpeedChange()
  42. HumanModCons.wsLoop = Human:GetPropertyChangedSignal("WalkSpeed"):Connect(WalkSpeedChange)
  43. end)
  44. end
  45. end
  46.  
  47. walkSpeedButton.MouseButton1Click:Connect(function()
  48. walkSpeedToggle = not walkSpeedToggle
  49. if walkSpeedToggle then
  50. walkSpeedButton.Text = "WalkSpeed: ON (50)"
  51. walkSpeedButton.BackgroundColor3 = Color3.fromRGB(0, 200, 100)
  52. setWalkSpeed(50)
  53. else
  54. walkSpeedButton.Text = "WalkSpeed: OFF"
  55. walkSpeedButton.BackgroundColor3 = Color3.fromRGB(70, 130, 255)
  56. setWalkSpeed(16)
  57.  
  58. if HumanModCons.wsLoop then
  59. HumanModCons.wsLoop:Disconnect()
  60. HumanModCons.wsLoop = nil
  61. end
  62. if HumanModCons.wsCA then
  63. HumanModCons.wsCA:Disconnect()
  64. HumanModCons.wsCA = nil
  65. end
  66. end
  67. end)
Advertisement
Add Comment
Please, Sign In to add comment