Advertisement
GUI_Maker_Roblox

Walkspeed

Mar 11th, 2023 (edited)
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. local Spoofed = {};
  2. local Clone = game.Clone;
  3. local oldIdx;
  4. local oldNewIdx;
  5. local OldNC;
  6.  
  7. getgenv().Settings = {
  8. Speed = 50
  9. }
  10.  
  11.  
  12. local Player = game:GetService("Players").LocalPlayer;
  13.  
  14. local Methods = {
  15. "FindFirstChild",
  16. "FindFirstChildOfClass",
  17. "FindFirstChildWhichIsA"
  18. }
  19.  
  20.  
  21.  
  22. local function SpoofProp(Instance, Property)
  23. local Cloned = Clone(Instance);
  24.  
  25. table.insert(Spoofed, {
  26. Instance = Instance,
  27. Property = Property;
  28. ClonedInstance = Cloned;
  29. })
  30. end
  31.  
  32.  
  33. oldIdx = hookmetamethod(game, "__index", function(self, key)
  34. for i,v in next, Spoofed do
  35. if self == v.Instance and key == v.Property and not checkcaller() then
  36. return oldIdx(v.ClonedInstance, key)
  37. end
  38.  
  39. if key == "Parent" and (self == v.ClonedInstance or self == v.Instance) and checkcaller() == false then
  40. return oldIdx(v.Instance, key)
  41. end
  42. end
  43.  
  44. return oldIdx(self, key)
  45. end)
  46.  
  47. oldNewIdx = hookmetamethod(game, "__newindex", function(self, key, newval, ...)
  48. for i,v in next, Spoofed do
  49. if self == v.Instance and key == v.Property and not checkcaller() then
  50. return oldNewIdx(v.ClonedInstance, key, newval, ...);
  51. end
  52. end
  53. return oldNewIdx(self, key, newval, ...)
  54. end)
  55.  
  56. OldNC = hookmetamethod(game, "__namecall", function(self, ...)
  57.  
  58. local Method = getnamecallmethod();
  59.  
  60. if not table.find(Methods, Method) or Player.Character == nil or self ~= Player.Character then
  61. return OldNC(self, ...)
  62. end
  63.  
  64. local Results = OldNC(self, ...);
  65.  
  66. if Results and Results:IsA("Humanoid") and Player.Character and self == Player.Character then
  67. for i,v in next, Spoofed do
  68. if v.Instance == Results then
  69. return v.ClonedInstance
  70. end
  71. end
  72. end
  73. return OldNC(self, ...)
  74. end)
  75.  
  76. for i, Method in next, Methods do
  77. local Old;
  78.  
  79. Old = hookfunction(game[Method], function(self, ...)
  80. if not Player.Character or self ~= Player.Character then
  81. return Old(self, ...)
  82. end
  83.  
  84. local Results = Old(self, ...);
  85.  
  86. if Results and Results:IsA("Humanoid") and Player.Character and self == Player.Character then
  87. for i,v in next, Spoofed do
  88. if v.Instance == Results then
  89. return v.ClonedInstance
  90. end
  91. end
  92. end
  93. return Old(self, ...)
  94. end)
  95. end
  96.  
  97. local character = Player.Character
  98.  
  99. SpoofProp(character.Humanoid, "WalkSpeed")
  100. character.Humanoid.WalkSpeed = Settings.Speed
  101.  
  102.  
  103. character.Humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
  104. character.Humanoid.WalkSpeed = Settings.Speed
  105. end)
  106.  
  107.  
  108. Player.CharacterAdded:Connect(function(character)
  109. character:WaitForChild("Humanoid")
  110. SpoofProp(character.Humanoid, "WalkSpeed")
  111. character.Humanoid.WalkSpeed = Settings.Speed
  112.  
  113. character.Humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function()
  114. character.Humanoid.WalkSpeed = Settings.Speed
  115. end)
  116. end)
  117.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement