HelperLib: add getObjectByGUID & immersive craft data methods

This commit is contained in:
Van
2026-02-13 21:03:01 +03:00
parent e9818fba24
commit 15bb906df7
3 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
---Returns an active object by unique identifier (GUID).
---* For players, this is a player name.
---* For Lua entities, this is a uniquely generated string, guaranteed not to collide with player names.
---
---**Note**: If an object with such an identifier does not exist or is inactive, the value `nil` will be returned.
---@param guid string only use printable ASCII characters. Example: `@bGh3p2AbRE29Mb4biqX6OA`.
---@return ObjectRef|Player|Entity|nil
function Smc.getObjectByGUID(guid)
local obj = core.objects_by_guid[guid]
if obj == nil then
return
else
return obj
end
end