you’d first want to make a LocalScript in StarterPlayerScripts or StarterCharacterScripts
Once you have the script, just get the services “MarketplaceService” and “Players” (the players service will be handy later)
Now, if you want a button so that if you press it, it pops up with the prompt. To do that, you’d want to put the whole function on a MouseButton1Click event
After that, you’d want to call up the function PromptPurchase(). Now, if you want a button so that if you press it, it pops up with the prompt. To do that, you’d want to put the whole function on a MouseButton1Click event. The first parameter is what player you want to display the purchase prompt to, and that’s why I said to make a LocalScript instead of a regular script, since you can just put
players.LocalPlayer
in the player parameter.
The second parameter is just to get the model ID, so just copy and paste it.
local market = game:GetService("MarketplaceService")
local players = game:GetService("Players")
local button = -- put the place of the button here
button.MouseButton1Click:Connect(function()
market:PromptPurchase(players.LocalPlayer, id)
end)
(replace “id” with the id of the free model you wanna put)
Now, you’d probably wanna make this more secure, maybe making smth that adds the script everytime someone removes it, but since i’m writing this at 11pm, i’m waaaaaaaaay to lazy to do that.