local gampass_id = 35168372
script.Parent.MouseButton1Click:Connect(function() game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, gampass_id)
end)
local gampass_id = 35168372
script.Parent.MouseButton1Click:Connect(function() game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer, gampass_id)
end)
If you want to make a gamepass for speed use this
game.Players.PlayerAdded:Connect(function(plr)
local speed = 30
wait(1)
local ownsGamepass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 35168372)
if ownsGamepass then
plr.Character.Humanoid.WalkSpeed = speed
end
end)
I think that's how it works..
This discussion is preserved as it was. New answers, comments, and votes are closed.
12 comments
it doesn't, but thx for effort
What does the error say?
nothing, it just doesnt work
wait, is there error panel or somthin? How to see errors?
Go to the View Tab and Output
it says nothing
i tried and tried but nothing is in the errors. Only when i delete ) from the ,,end" from my script, but then i can't click my button and this is probably why the error shows.
or no wait there is something. 21:04:48.614 MarketplaceService:PromptGamePassPurchase() player should be of type Player - Server - Script:3
i've put it in script instead of local script.
can u help me plzzzz
That error means that you didn't send the gamepass purchase correctly. You need to send the player Instance and the game pass's ID in order to correctly prompt a purchase.
how to do that?