Can someone please help me make a local script that increases max HP?
Can someone please help me make a local script that increases a player's max Hp after they buy a game pass?
I have tried for a few hours to make this local script but it won't work. this is what I have so far...
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local gamePassID = 6609505 -- Change this to your game pass ID
local function onPlayerAdded(player)
04 | local success, message = pcall ( function () |
05 | hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID) |
10 | warn( "Error while checking if player has pass: " .. tostring (message)) |
14 | if hasPass = = true then |
15 | print (player.Name .. " owns the game pass with ID " .. gamePassID) |
16 | player.CharacterAdded:Connect( function (character) |
17 | local humanoid = character:FindFirstChild( "Humanoid" ) |
18 | humanoid.MaxHealth = 500 |
end
-- Connect 'PlayerAdded' events to the 'onPlayerAdded()' function
Players.PlayerAdded:Connect(onPlayerAdded)
Can someone please help me???