local plr = game.Players.LocalPlayer
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local MarketplaceService, Jump_PassID = game:GetService("MarketplaceService"), 122361084
repeat wait() until game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
local Inputs = {
Enum.KeyCode.Space
}
plr.Character.Humanoid.JumpPower = 0 -- Normal: 50
UserInputService.InputBegan:Connect(function(Input, GameProcessed)
if not GameProcessed and (not plr:FindFirstChild("CanJump")) then
if table.find(Inputs, Input.KeyCode) then
MarketplaceService:PromptGamePassPurchase(plr, Jump_PassID)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function()
table.remove(Inputs)
game.Players.LocalPlayer.Character.Humanoid.JumpPower = 50
end)
end
end
end)
#How to successfully listen for when a player prompted finishes his decision of buying the gamepass
32 messages · Page 1 of 1 (latest)
you have to get their PurchaseDecision or something
dont know how
3rd returned value
wasPurchased
ty
Just add those to your anonymous function's parameter list
(player, assetId, isPurchased) dont understand "isPurchased"
Kind of similar to me not understanding WasPurchased: boolean
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamePassId, wasPurchased)
table.remove(Inputs)
game.Players.LocalPlayer.Character.Humanoid.JumpPower = 50
if wasPurchased then
-- do stuff
end
end)
That means that value will be returned as a Boolean, true/false
Cancellations will return false
local plr = game.Players.LocalPlayer
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local MarketplaceService, Jump_PassID = game:GetService("MarketplaceService"), 122361084
repeat wait() until game.Players.LocalPlayer.Character:FindFirstChild("Humanoid")
local Inputs = {
Enum.KeyCode.Space
}
plr.Character.Humanoid.JumpPower = 0 -- Normal: 50
UserInputService.InputBegan:Connect(function(Input, GameProcessed)
if not GameProcessed and (not plr:FindFirstChild("CanJump")) then
if table.find(Inputs, Input.KeyCode) then
MarketplaceService:PromptGamePassPurchase(plr, Jump_PassID)
MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(plr, Jump_PassID, WasPurchased)
if WasPurchased then
table.remove(Inputs)
game.Players.LocalPlayer.Changed.Humanoid.JumpPower = 50
end
end)
end
end
end)
``` dont know where to continue from here
whatdoyamean?
Yes i suppose im dumb
Nah, like was it not working?
ill show in a sec
You're not dumb lol
game.Players.LocalPlayer.Changed.Humanoid.JumpPower = 50 Error points to this line. What looks wrong here?
(trying to reinforce principles of debugging)
interesting
?
oml
Got it working but i got one for jump and walk and whenever u spam w/a/s/d/space(bar) then canel it will complete as a success