Basically, I'm trying to make a jump boost and if you have that game pass it will boost you then turn you back. Also if you don't have the game pass it will prompt you to buy it and not change your speed. I get no errors but It still does not work. Here is the code:
script.Parent.Touched:connect(function(player) -- make sure the part still exists if not script.Parent then return end -- make sure it's a humanoid local humanoid = script.Parent:FindFirstChild("Humanoid") if not humanoid then return end if game:GetService("GamePassService"):PlayerHasPass(player, 4907357) then humanoid.WalkSpeed = 16 * 5 wait(.3) humanoid.WalkSpeed = 16 else game:GetService("MarketplaceService"):PromptPurchase(player, 4907357) end end)
I think you are using the old gamepass method. Read this: https://devforum.roblox.com/t/live-changes-to-game-passes/116918
It seems like you're using the old "PlayerHasPass" method along with "PromptPurchase", Roblox recently changed this hence why it doesn't work. Here is a fix:
script.Parent.Touched:connect(function(player) -- make sure the part still exists if not script.Parent then return end -- make sure it's a humanoid local humanoid = script.Parent:FindFirstChild("Humanoid") if not humanoid then return end if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, 4907357) then humanoid.WalkSpeed = 16 * 5 wait(.3) humanoid.WalkSpeed = 16 else game:GetService("MarketplaceService"):PromptGamePassPurchase(player, 4907357) end end)
You may also want to test it out with Studio API on and try purchasing in a test server to make sure it works.
Hope this helps and let me know if you get any errors!