lua - 我的 roblox gamepass gui 有问题
问题描述
我正在尝试在游戏中制作商店 gui,但未出现购买提示并给我此错误消息Players.Miesels.PlayerGui.ShopGui.Frame.ItemButtons.PurchaseScript:10: attempt to index nil with 'Value'
这是 roblox 商店 gui 的脚本
local MarketplaceService = game:GetService("MarketplaceService")
local Player = game.Players.LocalPlayer
for i, Button in pairs(script.Parent:GetChildren()) do
if Button:IsA("ImageButton") or Button:IsA("TextButton") then
Button.MouseButton1Click:Connect(function()
local GamepassId = Button:FindFirstChild("GamepssId")
MarketplaceService:PromptGamePassPurchase(Player, GamepassId.Value)
end)
end
end
错误消息告诉我错误在“(Player,GamepassId.Value)”它是服务器脚本服务中的本地脚本
解决方案
推荐阅读
- html - 如何更改触发响应的引导宽度?
- linux-kernel - 在链接描述文件中移动位置计数器和制作空白空间有什么区别
- vb.net - 如何在 VB.net 中使用 Do-While 循环?
- paramiko - Paramiko 是否与 ScaleFT 一起使用?
- apache-spark - 如何在 Spark 结构化流中刷新数据帧
- r - 在 R 中使用 dplyr 在 group_by 之后应用自定义函数
- python-3.7 - 如何在python的列表中打印用户接受的数据?
- android - 如何在隐式 Intent 上首先显示一些应用程序?
- angular - 懒加载模块路由找不到
- prettytable - 如何在漂亮表中的行项目之间添加边界?