Advertisement
SxScripting

RogueWraith ServerScript

Aug 5th, 2021
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. --Constants
  2. local COOLDOWN = 3
  3. --Services
  4. local RS = game:GetService("ReplicatedStorage")
  5. local TS = game:GetService("TweenService")
  6. --Event
  7. local RST = RS:WaitForChild("Events").RougeShadow
  8. --Player Debounces
  9. local Debounce = {}
  10. --Changes How The Character Moves
  11. local function Speed(Character,Speed,Jump,IsStuck)
  12. Character.Humanoid.WalkSpeed = Speed
  13. Character.Humanoid.JumpPower = Jump
  14. Character.HumanoidRootPart.Anchored = IsStuck
  15. end
  16. --Function
  17. local function ShadowFunction(Player,CharacterRay,MouseRay)
  18. --Checks Things
  19. if not CharacterRay or not MouseRay then return end
  20. if Debounce[Player] then return end
  21. --Changes Debounce of Player
  22. Debounce[Player] = true
  23. --Things to Delete Later
  24. local Trash = {}
  25. --Variables
  26. local Character = Player.Character
  27. --Tweens
  28. local Tween1 = TS:Create(Character.HumanoidRootPart,TweenInfo.new(.8,Enum.EasingStyle.Quart,Enum.EasingDirection.InOut,0,false,.7),{Position = CharacterRay - Vector3.new(0,1,0)})
  29. local Tween2 = TS:Create(Character.HumanoidRootPart,TweenInfo.new(.5),{Position = MouseRay + Vector3.new(0,2,0)})
  30. --Disables Character Movement
  31. Speed(Character,0,0,true)
  32. --Changes The Player's Position
  33. Character.HumanoidRootPart.Position = CharacterRay + Vector3.new(0,3,0)
  34. --Creates Particles/Effects
  35. for i = 1,2 do
  36. local NewShadowPart = RS.Effects.ShadowPart:Clone()
  37. NewShadowPart.Parent = workspace
  38. Trash[#Trash + 1] = NewShadowPart
  39. end
  40. --Sets The Particles'/Effects' Positions
  41. Trash[1].Position = CharacterRay
  42. Trash[2].Position = MouseRay
  43. --Plays First Tween
  44. Tween1:Play()
  45. --Runs When First Tween Is Done
  46. Tween1.Completed:Connect(function()
  47. --Moves The Character
  48. Character.HumanoidRootPart.Position = MouseRay - Vector3.new(0,1,0)
  49. --Plays Second Tween
  50. Tween2:Play()
  51. end)
  52. --Runs When Second Tween Is Done
  53. Tween2.Completed:Connect(function()
  54. --Deletes All Trash
  55. for _, v in ipairs(Trash) do
  56. v:Destroy()
  57. end
  58. Trash = nil
  59. --Enables Character Movement
  60. Speed(Character,16,50,false)
  61. --Waits For The COOLDOWN
  62. task.wait(COOLDOWN)
  63. --Changes Debounce of Player
  64. Debounce[Player] = nil
  65. end)
  66. end
  67. --Runs When Remote Event Is Ran
  68. RST.OnServerEvent:Connect(ShadowFunction)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement