Hello, In my game I am trying to make a extra health game pass witch gives you 200 health instead of 100. My script is not working do you have any ideas?
local id = 6751836
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
if purchased and ido == id then
plr.Character.Humanoid.Health = 200
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
game.Workspace:WaitForChild(plr.Name):WairForChild("Humanoid").Health = 200
end
end)
end)

3 comments
At line 11, 'WairForChild' is not a method. I think you meant 'WaitForChild'. Remember to include the error in the thread next time.
Line 11 can be reduced to char.Humanoid.Health = 200 because 'char' is the character that was added. Remember that you don't need to wait for Humanoid because CharacterAdded fires after the Humanoid exists.
Where did you put this?