From dee13c5d2631b4b6e6595c4167c191dfdca43d82 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Wed, 12 Apr 2023 18:07:40 +0200 Subject: [PATCH] added delay for locking helpers --- src/core/Global.ttslua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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