I just want the button (textbutton) to check if you own the gamepass, if you do it gives you the perks, if you dont only then it prompts to purchase the gamepass. I tried fixing it on my own and know it must not be that hard but it didnt work.
local player = script.Parent.Parent.Parent.Parent
local button = script.Parent
local MarketServicePlace = game:GetService("MarketplaceService")
local id = 18020349
script.Parent.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, id)
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,id) == true then
player.Character.Humanoid.HeadScale.Value = 0.35
player.Character.Humanoid.BodyDepthScale.Value = 0.35
player.Character.Humanoid.BodyWidthScale.Value = 0.35
player.Character.Humanoid.BodyHeightScale.Value = 0.35
player.Character.Humanoid.WalkSpeed = 30
player.Character.Humanoid.JumpPower = 500
end
end)
end)

1 comment
Also if someone could help me that when you press the button after you shrinked that you grow back normally, would be amazing :D