Advertisement
SxScripting

Shadow Sneak[Local]

Dec 4th, 2022
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. repeat wait() until game.Players.LocalPlayer
  2. local UIS = game:GetService("UserInputService")
  3. local RS = game:GetService("ReplicatedStorage")
  4. local RunService = game:GetService("RunService")
  5.  
  6. local func = RS.Event.isShadowSneakCooldown
  7.  
  8. local Player = game.Players.LocalPlayer;
  9. local Camera = game.Workspace.Camera;
  10. local Character = Player.Character;
  11. local controlToggle = {true,true};
  12.  
  13. local BV = Instance.new("BodyVelocity");
  14.  
  15. local Speed = 75;
  16. local Radius = 3;
  17.  
  18. local Params = RaycastParams.new()
  19. Params.FilterDescendantsInstances = {Character};
  20. Params.FilterType = Enum.RaycastFilterType.Blacklist;
  21.  
  22. local Params2 = OverlapParams.new();
  23. Params2.MaxParts = math.huge
  24. Params2.FilterDescendantsInstances = {Character,game.Workspace.Baseplate}
  25. Params2.FilterType = Enum.RaycastFilterType.Blacklist;
  26.  
  27. UIS.InputBegan:Connect(function(Input, IsTyping)
  28. if IsTyping then return end
  29. if func:InvokeServer() then return end
  30. if Input.KeyCode == Enum.KeyCode.Z then
  31. if controlToggle[1] then
  32. RS.Event.SahdowSneak:FireServer(controlToggle[1],false);
  33. controlToggle[1] = false;
  34. controlToggle[2] = true;
  35.  
  36. BV.Parent = Character.HumanoidRootPart;
  37. else
  38. --Character:WaitForChild("Humanoid").JumpPower = 50;
  39. RS.Event.SahdowSneak:FireServer(controlToggle[1],false);
  40. controlToggle[1] = true;
  41. controlToggle[2] = false;
  42.  
  43. BV.MaxForce = Vector3.new()
  44. end
  45.  
  46. end
  47. end)
  48.  
  49. RunService.RenderStepped:Connect(function(dt)
  50. if not controlToggle[2] then return end
  51. if controlToggle[1] then return end
  52.  
  53. BV.MaxForce = Vector3.new(400000,0,400000);
  54.  
  55. local MainRay = workspace:Raycast((Character.HumanoidRootPart.CFrame).Position ,Vector3.new(0,-180,0),Params)
  56.  
  57. if MainRay then
  58. local i = 0;
  59. i+=1
  60. BV.Velocity = Camera.CFrame.LookVector * math.cos(i) * Speed -- math.tan() is faster
  61.  
  62. for Index,Value in pairs(workspace:GetPartBoundsInRadius((Character.HumanoidRootPart.CFrame).Position,Radius,Params2)) do
  63. if (Value.Parent:FindFirstChild("Humanoid")) then
  64. BV.MaxForce = Vector3.new();
  65. controlToggle[1] = true;
  66. controlToggle[2] = false;
  67. RS.Event.SahdowSneak:FireServer(controlToggle[2], true);
  68. end
  69. end
  70. end
  71.  
  72. end)
  73.  
  74. RS.Event.SahdowSneak.OnClientEvent:Connect(function(Player)
  75. controlToggle[1] = true;
  76. controlToggle[2] = false;
  77.  
  78. BV.MaxForce = Vector3.new()
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement