Skip to content

Add support for executors without game:GetObjects() #47

Description

@Tofi-Hub

been working on my own executor and had quite a trouble finding out a way to implement game:GetObjects() i believe you should add this function if it doesn't already exist in the executor, which i have done in my own profile and you can implement as so:
`local InsertService = getService("InsertService")

local function getobjs(_, path) -- fallback for getobjects in case it's not supported by the executor
local Objects = {}
if path then
local b = InsertService:LoadLocalAsset(path)
if b then
table.insert(Objects, b)
end
end
return Objects
end

local getobjects = nil
local success, err = pcall(function()
getobjects = game.GetObjects
end)

if not success or not getobjects then
getobjects = getobjs
end`

and then use it:
local Rayfield = useStudio and script.Parent:FindFirstChild('Rayfield') or getobjects(game, "rbxassetid://10804731440")[1]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions