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)
|