Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Constants
- local COOLDOWN = 3
- --Services
- local RS = game:GetService("ReplicatedStorage")
- local TS = game:GetService("TweenService")
- --Event
- local RST = RS:WaitForChild("Events").RougeShadow
- --Player Debounces
- local Debounce = {}
- --Changes How The Character Moves
- local function Speed(Character,Speed,Jump,IsStuck)
- Character.Humanoid.WalkSpeed = Speed
- Character.Humanoid.JumpPower = Jump
- Character.HumanoidRootPart.Anchored = IsStuck
- end
- --Function
- local function ShadowFunction(Player,CharacterRay,MouseRay)
- --Checks Things
- if not CharacterRay or not MouseRay then return end
- if Debounce[Player] then return end
- --Changes Debounce of Player
- Debounce[Player] = true
- --Things to Delete Later
- local Trash = {}
- --Variables
- local Character = Player.Character
- --Tweens
- 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)})
- local Tween2 = TS:Create(Character.HumanoidRootPart,TweenInfo.new(.5),{Position = MouseRay + Vector3.new(0,2,0)})
- --Disables Character Movement
- Speed(Character,0,0,true)
- --Changes The Player's Position
- Character.HumanoidRootPart.Position = CharacterRay + Vector3.new(0,3,0)
- --Creates Particles/Effects
- for i = 1,2 do
- local NewShadowPart = RS.Effects.ShadowPart:Clone()
- NewShadowPart.Parent = workspace
- Trash[#Trash + 1] = NewShadowPart
- end
- --Sets The Particles'/Effects' Positions
- Trash[1].Position = CharacterRay
- Trash[2].Position = MouseRay
- --Plays First Tween
- Tween1:Play()
- --Runs When First Tween Is Done
- Tween1.Completed:Connect(function()
- --Moves The Character
- Character.HumanoidRootPart.Position = MouseRay - Vector3.new(0,1,0)
- --Plays Second Tween
- Tween2:Play()
- end)
- --Runs When Second Tween Is Done
- Tween2.Completed:Connect(function()
- --Deletes All Trash
- for _, v in ipairs(Trash) do
- v:Destroy()
- end
- Trash = nil
- --Enables Character Movement
- Speed(Character,16,50,false)
- --Waits For The COOLDOWN
- task.wait(COOLDOWN)
- --Changes Debounce of Player
- Debounce[Player] = nil
- end)
- end
- --Runs When Remote Event Is Ran
- RST.OnServerEvent:Connect(ShadowFunction)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement