Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- SETTINGS
- local initialvelocity = 50
- local timecap = 4
- -- SCRIPT
- function Use(...)
- local isthisdone = true
- local timecounter = 0
- local shouldistrafe = 0
- local drawme = 0
- local args = {...}
- local nearestdistance = math.huge
- local nearestplayer
- for _, i in pairs(game.Players:GetPlayers()) do
- local distancecheck = i:DistanceFromCharacter(args[1].Torso.Position)
- if distancecheck < nearestdistance then
- nearestplayer = i
- nearestdistance = distancecheck
- end
- end
- coroutine.wrap(function()
- while isthisdone == true do
- for i=0, 1, 0.1 do
- args[1].HumanoidRootPart.CFrame = args[1].HumanoidRootPart.CFrame:lerp(CFrame.lookAt(args[1].HumanoidRootPart.Position, Vector3.new(nearestplayer.Character.Torso.Position.X, args[1].HumanoidRootPart.Position.Y, nearestplayer.Character.Torso.Position.Z)), i)
- --args[1].HumanoidRootPart.CFrame *= CFrame.Angles(0,math.rad(1),0)
- wait()
- end
- end
- end)()
- local bv = Instance.new("BodyVelocity", args[1].Torso)
- bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
- while timecap > timecounter and (args[1].Torso.Position - nearestplayer.Character.Torso.Position).Magnitude > 9 do
- bv.velocity = (args[1].Torso.CFrame * CFrame.Angles(0,math.rad(90*math.ceil(shouldistrafe)),0)).LookVector * initialvelocity * (1 - (timecounter / timecap))
- if timecounter > timecap/4 and (args[1].Torso.Position - nearestplayer.Character.Torso.Position).Magnitude < (initialvelocity * (1.25 - (timecounter / timecap))) and math.random(1,50) == 1 and shouldistrafe == 0 then
- timecounter -= timecap/4
- shouldistrafe = 1
- drawme = 3
- end
- timecounter += 0.1
- if shouldistrafe > 0.1 then
- shouldistrafe -= 0.1
- end
- if shouldistrafe == 0.1 then
- timecounter -= timecap/8
- shouldistrafe = 0
- end
- if drawme > 0 then
- if drawme % 1 == 0 then
- for _, i in pairs(args[1].BTorso:GetChildren()) do
- local i2 = i:Clone()
- coroutine.wrap(function()
- for v = 0, 1, 0.1 do
- i2.Transparency = v
- wait(0.1)
- end
- i2:Destroy()
- end)()
- end
- end
- drawme -= 0.5
- end
- wait(0.1)
- end
- isthisdone = false
- for i=0, 1, 0.2 do
- args[1].HumanoidRootPart.CFrame = args[1].HumanoidRootPart.CFrame:lerp(CFrame.lookAt(args[1].HumanoidRootPart.Position, Vector3.new(nearestplayer.Character.Torso.Position.X + nearestplayer.Character.Torso.Velocity.X, args[1].HumanoidRootPart.Position.Y, nearestplayer.Character.Torso.Position.Z + nearestplayer.Character.Torso.Velocity.Z)), i)
- --args[1].HumanoidRootPart.CFrame *= CFrame.Angles(0,math.rad(1),0)
- wait()
- endMarisad (bad)
- bv.Velocity = args[1].Torso.CFrame.LookVector
- wait(timecap/(2 * timecounter))
- bv:Destroy()
- local attachment = Instance.new("Attachment", args[1].Torso)
- attachment.CFrame = args[1].Torso.CFrame
- local vf = Instance.new("VectorForce", game.Workspace)
- vf.Attachment0 = attachment
- vf.ApplyAtCenterOfMass = true
- vf.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
- vf.Force = Vector3.new(-100000,100000,0)
- wait(1)
- local explosion = Instance.new("Explosion", args[1].Torso)
- explosion.DestroyJointRadiusPercent = 0
- explosion.BlastPressure = 0
- explosion.Position = args[1].Torso.Position
- attachment:Destroy()
- vf:Destroy()
- end
- return Use
Add Comment
Please, Sign In to add comment