【发布时间】:2022-01-24 21:13:57
【问题描述】:
我通读了 Roblox 开发者中心,了解如何使 ProximityPrompt 工作,我可以让它做某些事情,但我希望能够在游戏 gui 商店中打开一个。我找不到如何调用 Frame 以使其可见,也找不到如何让 Frame 寻找正确的触发器。
以下是我添加到 Frame localScript 中的内容
local prompt = game:GetService("ProximityPromptService")
local button = game.Workspace.MinerStore.ProximityPrompt.Triggered:WaitForChild()
local function prompt(PromptObject, player)
frame.Visible = not frame.Visible
这就是我的提示脚本显示的内容。
local frame = game.StarterGui.Miners:WaitForChild("Frame")
game.Workspace.MinerStore.ProximityPrompt.Triggered:Connect(function(player)
--game.StarterGui.Miners.Frame:Connect(function(player)
-- frame.Visible = not frame.Visible
--end)
end)
我从开发者中心获得了所有这些权利,并试图将其变成我自己的,但由于我不明白的原因,两者没有联系。
【问题讨论】: