DragonYTPastesWork

Untitled

Aug 18th, 2020
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1.  
  2. local id = YOUR_ID_HERE
  3.  
  4. local uis = game:GetService("UserInputService")
  5.  
  6. local character = script.Parent
  7. local humanoid = character:WaitForChild("Humanoid")
  8. local anim = Instance.new("Animation")
  9. anim.AnimationId = anim_id_here
  10.  
  11. local animation = humanoid:LoadAnimation(anim)
  12.  
  13. local debounce = false
  14. local timeSinceLastJump = tick()
  15. local cooldown = 0.2
  16.  
  17. local function jump()
  18. if tick() - timeSinceLastJump >= cooldown then
  19. if humanoid:GetState() == Enum.HumanoidStateType.Freefall and not debounce then
  20. debounce = true
  21. humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
  22. animation:Play()
  23. end
  24. end
  25. end
  26.  
  27.  
  28. humanoid.StateChanged:Connect(function(oldState, newState)
  29. if newState == Enum.HumanoidStateType.Landed then
  30. debounce = false
  31. elseif newState == Enum.HumanoidStateType.Jumping then
  32. timeSinceLastJump = tick()
  33. end
  34. end)
  35.  
  36.  
  37.  
  38. game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
  39. if purchased and ido == id then
  40. uis.JumpRequest:Connect(jump)
  41. end
  42. end)
  43.  
  44. game.Players.PlayerAdded:Connect(function(plr)
  45. plr.CharacterAdded:connect(function(char)
  46. if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
  47. uis.JumpRequest:Connect(jump)
  48. end
  49. end)
  50. end)
  51.  
Advertisement
Add Comment
Please, Sign In to add comment