Plugin

사용되지 않는 항목 표시

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.

만들 수 없음

코드 샘플

Script - Pass the Plugin Global to a ModuleScript

assert(plugin, "This script must be run as a plugin!")
-- Code beyond this point will execute only if the script is run as a plugin
-- Load the module and pass the plugin reference
local pluginModule = require(script.Parent.PluginModule)
pluginModule:Initialize(plugin)
-- Verify if the plugin reference was initialized
pluginModule:CheckForPluginGlobal()
ModuleScript - Receive and Store the Plugin Global

local pluginModule = {}
local plugin -- Local plugin reference
-- Initialize the plugin reference if not already set
function pluginModule:Initialize(pluginReference: Plugin)
if plugin ~= pluginReference then
plugin = pluginReference
else
error("Plugin is already initialized")
end
end
-- Check if the plugin reference is set and print out appropriate info
function pluginModule:CheckForPluginGlobal()
if plugin ~= nil then
print("Plugin reference is set!")
else
warn("Plugin reference is missing!")
end
end
return pluginModule

요약

속성

메서드

속성

CollisionEnabled

읽기 전용
복제되지 않음
병렬 읽기

DisableUIDragDetectorDrags

Roblox 스크립트 보안
병렬 읽기

GridSize

읽기 전용
복제되지 않음
병렬 읽기

IsDebuggable

Roblox 스크립트 보안
병렬 읽기

메서드

Activate

()
플러그인 보안

매개 변수

exclusiveMouse: boolean
기본값: ""

반환

()

CreatePluginAction

플러그인 보안

매개 변수

actionId: string
기본값: ""
text: string
기본값: ""
statusTip: string
기본값: ""
iconName: string
기본값: ""
allowBinding: boolean
기본값: true

반환

코드 샘플

Creating a PluginAction

local pluginAction = plugin:CreatePluginAction(
"HelloWorldAction",
"Hello World",
"Prints a 'Hello world!'",
"rbxasset://textures/sparkle.png",
true
)
pluginAction.Name = "Test Action"
local function actionTriggered()
print("Hello world!")
end
pluginAction.Triggered:Connect(actionTriggered)

CreatePluginMenu

플러그인 보안

매개 변수

id: string
기본값: ""
title: string
기본값: ""
icon: string
기본값: ""

반환

코드 샘플

Creating a PluginMenu and PluginMenuAction

-- This code can be pasted into the command bar, but only once
local pluginMenu = plugin:CreatePluginMenu(math.random(), "Test Menu")
pluginMenu.Name = "Test Menu"
pluginMenu:AddNewAction("ActionA", "A", "rbxasset://textures/loading/robloxTiltRed.png")
pluginMenu:AddNewAction("ActionB", "B", "rbxasset://textures/loading/robloxTilt.png")
local subMenu = plugin:CreatePluginMenu(math.random(), "C", "rbxasset://textures/explosion.png")
subMenu.Name = "Sub Menu"
subMenu:AddNewAction("ActionD", "D", "rbxasset://textures/whiteCircle.png")
subMenu:AddNewAction("ActionE", "E", "rbxasset://textures/icon_ROBUX.png")
pluginMenu:AddMenu(subMenu)
pluginMenu:AddSeparator()
pluginMenu:AddNewAction("ActionF", "F", "rbxasset://textures/sparkle.png")
local toggle = Instance.new("BoolValue")
toggle.Name = "TogglePluginMenu"
toggle.Parent = workspace
local function onToggled()
if toggle.Value then
toggle.Value = false
local selectedAction = pluginMenu:ShowAsync()
if selectedAction then
print("Selected Action:", selectedAction.Text, "with ActionId:", selectedAction.ActionId)
else
print("User did not select an action!")
end
end
end
toggle.Changed:Connect(onToggled)

CreateToolbar

플러그인 보안

매개 변수

name: string
기본값: ""

반환

코드 샘플

Plugin:CreateToolbar

plugin:CreateToolbar("ExampleToolbar")

Deactivate

()
플러그인 보안

반환

()
플러그인 보안

반환

GetMouse

플러그인 보안

반환

코드 샘플

Plugin:GetMouse

local mouse = plugin:GetMouse()
local function button1Down()
print("Button 1 pressed from PluginMouse")
end
mouse.Button1Down:Connect(button1Down)

GetSelectedRibbonTool

플러그인 보안

반환

코드 샘플

Plugin:GetSelectedRibbonTool

plugin:SelectRibbonTool(Enum.RibbonTool.Move, UDim2.new())
task.wait() -- wait for next frame
local selectedRibbonTool = plugin:GetSelectedRibbonTool()
print("The selected RibbonTool is", selectedRibbonTool)

GetSetting

Variant
플러그인 보안

매개 변수

key: string
기본값: ""

반환

Variant

코드 샘플

Plugin:GetSetting

local RAN_BEFORE_KEY = "RanBefore"
local didRunBefore = plugin:GetSetting(RAN_BEFORE_KEY)
if didRunBefore then
print("Welcome back!")
else
plugin:SetSetting(RAN_BEFORE_KEY, true)
print("Welcome! Thanks for installing this plugin!")
end

Intersect

플러그인 보안

매개 변수

objects: Instances
기본값: ""

반환

IsActivated

플러그인 보안

반환

IsActivatedWithExclusiveMouse

플러그인 보안

반환

Negate

Instances
플러그인 보안

매개 변수

objects: Instances
기본값: ""

반환

Instances

OpenScript

()
플러그인 보안

매개 변수

기본값: ""
lineNumber: number
기본값: 1

반환

()

코드 샘플

Plugin:OpenScript

local newScript = Instance.new("Script")
newScript.Parent = workspace
plugin:OpenScript(newScript)

OpenWikiPage

()
플러그인 보안

매개 변수

url: string
기본값: ""

반환

()

코드 샘플

Plugin:OpenWikiPage

plugin:OpenWikiPage("API:Class/BasePart")

SaveSelectedToRoblox

()
플러그인 보안

반환

()

SelectRibbonTool

()
플러그인 보안

매개 변수

기본값: ""
position: UDim2
기본값: ""

반환

()

Separate

Instances
플러그인 보안

매개 변수

objects: Instances
기본값: ""

반환

Instances

SetSetting

()
플러그인 보안

매개 변수

key: string
기본값: ""
value: Variant
기본값: ""

반환

()

코드 샘플

Plugin:GetSetting and Plugin:SetSetting

local RAN_BEFORE_KEY = "RunBefore"
local hasRunBefore = plugin:GetSetting(RAN_BEFORE_KEY)
if hasRunBefore then
print("Welcome back!")
else
print("Thanks for installing this plugin!")
plugin:SetSetting(RAN_BEFORE_KEY, true)
end

StartDrag

()
플러그인 보안

매개 변수

dragData: Dictionary
기본값: ""

반환

()

코드 샘플

Plugin Drag and Drop

assert(plugin, "This script must be run as a Studio plugin")
local widgetInfo = DockWidgetPluginGuiInfo.new(Enum.InitialDockState.Float, true, true, 300, 200)
local dragSourceWidget = plugin:CreateDockWidgetPluginGui("Drag Source", widgetInfo)
dragSourceWidget.Title = "Drag Source"
local textBox = Instance.new("TextBox")
textBox.Parent = dragSourceWidget
textBox.Size = UDim2.new(1, 0, 0, 32)
textBox.Text = "Hello, plugin drags"
local dragButton = Instance.new("TextButton")
dragButton.Size = UDim2.new(1, 0, 1, -32)
dragButton.Position = UDim2.new(0, 0, 0, 32)
dragButton.Text = "Edit the text above, then start drag here"
dragButton.Parent = dragSourceWidget
function onMouseButton1Down()
local dragData = {
Sender = "SomeDragSource",
MimeType = "text/plain",
Data = textBox.Text,
MouseIcon = "",
DragIcon = "",
HotSpot = Vector2.new(0, 0),
}
plugin:StartDrag(dragData)
end
dragButton.MouseButton1Down:Connect(onMouseButton1Down)
-- This widget will receive drops
local dragTargetWidget = plugin:CreateDockWidgetPluginGui("Drop Target", widgetInfo)
dragTargetWidget.Title = "Drop Target"
-- This TextLabel will display what was dropped
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Text = "Drop here..."
textLabel.Parent = dragTargetWidget
local function onDragDrop(dragData)
if dragData.MimeType == "text/plain" then
textLabel.Text = dragData.Data
else
textLabel.Text = dragData.MimeType
end
end
dragTargetWidget.PluginDragDropped:Connect(onDragDrop)
dragTargetWidget.PluginDragEntered:Connect(function(_dragData)
print("PluginDragEntered")
end)
dragTargetWidget.PluginDragLeft:Connect(function(_dragData)
print("PluginDragLeft")
end)
dragTargetWidget.PluginDragMoved:Connect(function(_dragData)
print("PluginDragMoved")
end)
플러그인 보안

매개 변수

objects: Instances
기본값: ""

반환

CreateDockWidgetPluginGui

생성
플러그인 보안

매개 변수

pluginGuiId: string
기본값: ""
dockWidgetPluginGuiInfo: DockWidgetPluginGuiInfo
기본값: ""

반환

코드 샘플

Widget GUI Text Button

-- Create new 'DockWidgetPluginGuiInfo' object
local widgetInfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float, -- Widget will be initialized in floating panel
true, -- Widget will be initially enabled
false, -- Don't override the previous enabled state
200, -- Default width of the floating window
300, -- Default height of the floating window
150, -- Minimum width of the floating window (optional)
150 -- Minimum height of the floating window (optional)
)
-- Create new widget GUI
local testWidget = plugin:CreateDockWidgetPluginGui("TestWidget", widgetInfo)
local testButton = Instance.new("TextButton")
testButton.BorderSizePixel = 0
testButton.TextSize = 20
testButton.TextColor3 = Color3.new(1, 0.2, 0.4)
testButton.AnchorPoint = Vector2.new(0.5, 0.5)
testButton.Size = UDim2.new(1, 0, 1, 0)
testButton.Position = UDim2.new(0.5, 0, 0.5, 0)
testButton.SizeConstraint = Enum.SizeConstraint.RelativeYY
testButton.Text = "Click Me"
testButton.Parent = testWidget

ImportFbxAnimation

생성
플러그인 보안

매개 변수

rigModel: Instance
기본값: ""
isR15: boolean
기본값: true

반환

ImportFbxRig

생성
플러그인 보안

매개 변수

isR15: boolean
기본값: true

반환

PromptForExistingAssetId

생성
플러그인 보안

매개 변수

assetType: string
기본값: ""

반환

PromptSaveSelection

생성
플러그인 보안

매개 변수

suggestedFileName: string
기본값: ""

반환

이벤트

Deactivation

플러그인 보안

Unloading

플러그인 보안