Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local id = YOUR_ID_HERE
- local uis = game:GetService("UserInputService")
- local character = script.Parent
- local humanoid = character:WaitForChild("Humanoid")
- local anim = Instance.new("Animation")
- anim.AnimationId = anim_id_here
- local animation = humanoid:LoadAnimation(anim)
- local debounce = false
- local timeSinceLastJump = tick()
- local cooldown = 0.2
- local function jump()
- if tick() - timeSinceLastJump >= cooldown then
- if humanoid:GetState() == Enum.HumanoidStateType.Freefall and not debounce then
- debounce = true
- humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
- animation:Play()
- end
- end
- end
- humanoid.StateChanged:Connect(function(oldState, newState)
- if newState == Enum.HumanoidStateType.Landed then
- debounce = false
- elseif newState == Enum.HumanoidStateType.Jumping then
- timeSinceLastJump = tick()
- end
- end)
- game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
- if purchased and ido == id then
- uis.JumpRequest:Connect(jump)
- end
- end)
- game.Players.PlayerAdded:Connect(function(plr)
- plr.CharacterAdded:connect(function(char)
- if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
- uis.JumpRequest:Connect(jump)
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment