【发布时间】:2021-12-20 19:08:56
【问题描述】:
我正在尝试使用的按钮位于 StarterGUI 中。不知道有没有帮助。脚本编写相当新,但是看到另一篇类似的帖子并使用了该代码。这是我在 LocalScript 中的代码:
local MarketplaceService = game:GetService("MarketplaceService")
local player = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PurchaseEvent = ReplicatedStorage.PurchaseEvent
local productID = 1218445531
script.Parent.MouseButton1Click:Connect(function()
PurchaseEvent:FireServer(productID)
end)
if MarketplaceService:PlayerOwnsAsset(1218445531) then
--Here is where the thing is supposed to happen
end
【问题讨论】: