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)

2 comments
Still dose not work.
Have you got Studio API on? Sometimes this contributes to the problem.