Advertisement
FXDuke

Slowness

Sep 18th, 2022
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. -- Someone asked me to make this for free
  2. local Slowness = {};
  3. Slowness = {
  4.     active = {};
  5.     default_speed = 16; -- Change this to your normal speed
  6.     begin = function(player, amount)
  7.         if player.Character and player.Character:FindFirstChildOfClass("Humanoid") then
  8.             table.insert(Slowness.active, {Name=player.Name,Amount=amount,plr=player});
  9.         end;
  10.     end;
  11.     stop = function(player)
  12.         for _,v in pairs(Slowness.active) do
  13.             if v.Name == player.Name then
  14.                 table.remove(Slowness.active, _);
  15.             end;
  16.         end;
  17.         if player.Character and player.Character:FindFirstChildOfClass("Humanoid") then
  18.             player.Character:FindFirstChildOfClass("Humanoid").WalkSpeed = Slowness.default_speed;
  19.         end;
  20.     end;
  21. };
  22. task.spawn(function()
  23.     while task.wait() do
  24.         for _,v in pairs(Slowness.active) do
  25.             local player = v.plr;
  26.             if player.Character and player.Character:FindFirstChildOfClass("Humanoid") then
  27.                 player.Character:FindFirstChildOfClass("Humanoid").WalkSpeed = v.Amount;
  28.             end;
  29.         end;
  30.     end;
  31. end);
  32. return Slowness;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement