Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it Possible to use PromptProductPurchase in a Regular Script?

Asked by 4 years ago

On the wiki I noticed how most of the code for this method is in a localscript and I wanted to know if you could use it in a regular script for when players touch a part.

1 answer

Log in to vote
1
Answered by 4 years ago

I don't think so, however, you could add a local script to the players starterpack with the following code:

local part = game.Workspace:WaitForChild('Your Part')
local player = game.Players.LocalPlayer
local char = player:GetCharacter()

part.Touched:Connect(function(hit)

if hit.Parent.Name == char.Name then

add your prompt product purchase here.

0
Gotcha, thanks! Retr0Thief 104 — 4y
0
np mrorangethegamer 81 — 4y
Ad

Answer this question