Home / Misc

getPlugin()

getPlugin(name)

Returns a live, read-only proxy to another plugin's exports table.

Parameters

NameTypeDescription
namestringThe name of the plugin to access.

Returns

A read-only proxy table. Looking up fields returns values from the named plugin's exports, or nil if the plugin is not enabled or that export is absent.

Example

if hasPlugin("Clock") then
  local clock = getPlugin("Clock")
  if clock.setDay then clock.setDay() end
end

Notes

The proxy follows reloads. Missing or unloaded exports return nil.