of     1   

EmperorTerminus
#184201418Tuesday, February 23, 2016 7:05 PM GMT

I know the answer to my question is pretty obvious but how do I actually give the player who has bought this pass a max health of 140? local passId = 363266884 function isAuthenicated(player) return game:GetService("MarketplaceService"):PlayerOwnsAsset(player,passId) end game.Players.PlayerAdded:connect(function(plr) if isAuthenticated(plr) then print(plr.Name .. "has bought the game pass with id " .. passId) end end) local marketplaceService = game:GetService("MarketplaceService") marketplaceService.PromptPurchaseFinished:connect(function(player,assetId,isPurchased) if isPurchased then if assetId == passId then local part = Workspace:WaitForChild("Player") MaxHealth = part.Humanoid.MaxHealth Health = part.Humanoid.Health MaxHealth = 140 Health = 140 end end end)
WoolHat
#184201673Tuesday, February 23, 2016 7:13 PM GMT

local passId = 363266884 local Marketplace = game:GetService("MarketplaceService") function grantHealth(Player) repeat wait() until Player.Character Humanoid = Player.Character.Humanoid Humanoid.MaxHealth = 140 Humanoid.Health = 140 end game.Players.PlayerAdded:connect(function(plr) if Marketplace:PlayerOwnsAsset(player,passId) then grantHealth(Player) print(plr.Name .. "has bought the game pass with id " .. passId) end end) local marketplaceService = game:GetService("MarketplaceService") marketplaceService.PromptPurchaseFinished:connect(function(player,assetId,isPurchased) if isPurchased then if assetId == passId then grantHealth(player) end end end) That might work.
EmperorTerminus
#184202408Tuesday, February 23, 2016 7:33 PM GMT

That does not work, I am afraid.
WoolHat
#184210747Tuesday, February 23, 2016 10:23 PM GMT

well do you have a prompt for a purchase at some point in the script? if not, then that's not a problem with what I've done, that's just something that's been left out.
EmperorTerminus
#184306897Thursday, February 25, 2016 6:38 PM GMT

Surely, this line of code can make a reference to the "Prompt." marketplaceService.PromptPurchaseFinished:connect(function(player,assetId,isPurchased)
Zarkonan_Zenheart
#184306960Thursday, February 25, 2016 6:39 PM GMT

That entire script is server sided. If you're looking to prompt the player to buy something (which is what I've gathered) you want to do it from a localscript somewhere.
Zarkonan_Zenheart
#184307074Thursday, February 25, 2016 6:42 PM GMT

Sorry, reread the problem. I'm assuming this only works the first time the you load in. Add in a CharacterAdded() event and then repeat the health code inside that if they have the pass.
EmperorTerminus
#184359209Friday, February 26, 2016 7:11 PM GMT

Prior to the addition of line 1, the script is still not working. player.CharacterAdded:connect(function(character) local passId = 363266884 local Marketplace = game:GetService("MarketplaceService") function grantHealth(Player) repeat wait() until Player.Character Humanoid = Player.Character.Humanoid Humanoid.MaxHealth = 140 Humanoid.Health = 140 end game.Players.PlayerAdded:connect(function(plr) if Marketplace:PlayerOwnsAsset(player,passId) then grantHealth(Player) print(plr.Name .. "has bought the game pass with id " .. passId) end end) local marketplaceService = game:GetService("MarketplaceService") marketplaceService.PromptPurchaseFinished:connect(function(player,assetId,isPurchased) if isPurchased then if assetId == passId then grantHealth(player)

    of     1