Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function copyBag(count, positions)
- local bagTable = Global.getTable('bags')
- local terrainBag = getObjectFromGUID(bagTable.terrain.guid)
- local pos = {x = math.random(0, xMax) * step + start.x, y = start.y, z = math.random(0, zMax) * step + start.z}
- if positions ~= nil then
- pos = positions[1]
- end
- local object = takeO(terrainBag, self.getName(), pos) --<---Pulls out the first object and places it
- -- you have to put things here to check for the first object
- if count > 1 then --<-----------If more then one object has to be pulled out it has to copy it
- Wait.condition(
- function()
- for i=2, count do
- if positions ~= nil then --<---------- This will only be executed when more then 1 object will be copied
- object.clone({position = positions[i]})
- else
- object.clone({position = {x = math.random(0, xMax) * step + start.x, y = start.y, z = math.random(0, zMax) * step + start.z}})
- end
- -- you have to put things here for checks of the next objects but oyu have to use a variable before the if like at the botton for the putObject
- end
- end,
- function()
- return checkLoaded(object)
- end
- )
- end
- object.clone({position = terrainBag.getPosition()}) --<-- I meant this Clone is the putting bag clone
- --Here has to come the stuff for putObject
- --like
- -- local newObj = object.clone({position = terrainBag.getPosition()})
- -- Wait.condition(function() terrainBag.putObject(newObj) end, function() return checkLoaded(newObj) end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement