Advertisement
IHATEMICROWAVEOVEN

jump template

Oct 5th, 2022 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. local TweenService = game:GetService("TweenService")
  2.  
  3. local function Use(...)
  4. -- Declare variables for later
  5. local args = {...}
  6. local finished = false
  7. local cuenta = math.random(2, 3) -- spanish for "goat"
  8. local hum = args[1].Character.Humanoid
  9. local torso = args[1].Character.Torso
  10.  
  11. -- Anchor the user and set up the "charging" part
  12. torso.Anchored = true
  13. local p = Instance.new("Part")
  14. p.Size, p.Anchored, p.CFrame = Vector3.new(3, 3, 3), true, torso.CFrame
  15. -- p.Anchored = true
  16. -- p.CFrame = torso.CFrame
  17. -- put more propeeties
  18. p.Parent = workspace
  19. local grow = TweenService:Create(p, TweenInfo.new(0.2, Enum.EasingStyle.Linear), {Size = Vector3.new(7, 7, 7)}
  20. local shrink = TweenService:Create(p, TweenInfo.new(0.2, Enum.EasingStyle.Linear), {Size = Vector3.new(3, 3, 3)}
  21.  
  22. -- Activate the "charging" part, then explode
  23. for i = 1,cuenta do
  24. grow:Play()
  25. task.wait(0.3)
  26. shrink:Play()
  27. task.wait(0.3)
  28. end
  29. p:Destroy()
  30. local exp = Instance.new("Explosion")
  31. exp.BlastPressure, exp.BlastRadius, exp.ExplosionType, exp.Position = 0, 0, Enum.ExplosionType.NoCraters, torso.Position
  32. exp.Parent = workspace
  33.  
  34. -- Set up a time limit for activating the move
  35. local limit = tick() + 20
  36. coroutine.wrap(function()
  37. repeat task.wait(1) until tick() >= limit or hum:GetState() == Enum.HumanoidStateType.Died or finished
  38. finished = true
  39. end)()
  40.  
  41. -- Wait for the user to enter landing anim before activating the move (if they don't jump or whatever, the time limit gets them)
  42. if hum:GetState() ~= Enum.HumanoidStateType.Freefall then
  43. repeat task.wait(1/60) until hum:GetState() == Enum.HumanoidStateType.Jumping or finished
  44. end
  45. repeat task.wait(1/60) until hum:GetState() == Enum.HumanoidStateType.Landed or tick() >= limit or finished
  46. finished = true
  47.  
  48. -- Perform AoE and explode
  49.  
  50. -- Make melee hitbox, increase speed, cut HP, disable jump, disable moves
  51.  
  52. -- Perform last AoEs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement