RedditPP Mascot

RedditPP

r/tabletopsimulator • … • u/the_singular_anyone

[LUA] Trying to make a cube that reloads other objects on load

OneWorld is kind of fucky at best sometimes, and I've noticed that after loading objects, it doesn't load their colliders right. If I manually reload the errored objects the collider figures itself out, however, so I made a cube with code on it to be loaded in each map with this issue:

```local reloadObjs = {"800c48", "0d97ba", "fca0d7", "2409cf", "280a12"}```

```Wait.time(function() ```

``` for i=1, #reloadObjs do```

``` reObj = getObjectFromGUID(reloadObjs[i])```

``` reObj.reload()```

``` end```

``` end, 2)```

And that's all fine, I just have to hard-code each cube. Which I don't want to do.

I want to put a series of GUIDs for objects in the cube's description and have the cube import them as a table, and then run that table through the for-loop. That way I can just load in a cube and add GUIDs to its description, rather than having to open up the code of the thing whenever I need to add a new object.

Any ideas? Making one type of variable into another is a huge stumbling block for me.

— 0