Skip to content

Instantly share code, notes, and snippets.

@Priler
Created May 9, 2025 14:35
Show Gist options
  • Save Priler/63aabbdc21dc7810ebe116df342e9723 to your computer and use it in GitHub Desktop.
Save Priler/63aabbdc21dc7810ebe116df342e9723 to your computer and use it in GitHub Desktop.
function EnsureStaticObject(objectName, retryInterval)
LogMessage(string.format("EnsureStaticObject: %s", objectName))
local objectToFind = nil
while not (objectToFind and objectToFind:IsValid()) do
LogMessage(string.format("Calling StaticFindObject: %s", objectName))
objectToFind = StaticFindObject(objectName)
end
LogMessage("EnsureStaticObject Finished")
-- Finally return the object
return objectToFind
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment