在roblox studio上,如何在选择对话框选项后才激活脚本?

时间:2018-01-09 16:01:41

标签: roblox

我需要这个才能得到解决吗?

1 个答案:

答案 0 :(得分:0)

在对话框选项上插入脚本。
该脚本看起来像这样:

local dialog = script.Parent
local activateScript = game.Workspace.["Name Of Your Script"] --Or whatever the path is

dialog.DialogChoiceSelected:connect(function(player, choice) --This is getting the service when the choice is selected
    if choice == script.Parent.DialogChoice.ChoiceA then --Choice A is what you named the option in studio
        --Do what you want to do
        activateScript.Disabled = false --Activated Script
    end
    elseif choice = script.Parent.DialogChoice.ChoiceB then
       --Do what you want
    end
    --Repeat for all choices
end)

如果您有任何问题请随时提出,如果我知道,我会回答。
还有一个维基页面here