diff --git a/src/core/Global.ttslua b/src/core/Global.ttslua index d5d029e2..5db7670f 100644 --- a/src/core/Global.ttslua +++ b/src/core/Global.ttslua @@ -907,9 +907,7 @@ end function spawnOrRemoveHelper(state, name, position, rotation) if state then Player.getPlayers()[1].pingTable(position) - local spawnedHelper = spawnHelperObject(name, position, rotation) - spawnedHelper.setLock(true) - return spawnedHelper.getGUID() + return spawnHelperObject(name, position, rotation).getGUID() else return removeHelperObject(name) end @@ -937,6 +935,9 @@ function spawnHelperObject(name, position, rotation) for _, obj in ipairs(sourceBag.getData().ContainedObjects) do if obj["Nickname"] == name then spawnTable.data = obj + spawnTable.callback_function = function(spawnedObj) + Wait.time(function() spawnedObj.setLock(true) end, 1) + end return spawnObjectData(spawnTable) end end