Log in

View Full Version : [Help] Back Backpack



7878952
03-27-2019, 06:31 PM
I need help with this script, I will explain when the backpack is empty items I want a backpack to go back just need help for the backpack to return 1 when empty.

I really need help I have a very good system but I do not know how to make it go back.

I think it is with this

function Back_Items_Backpack()
if(Container(CONFIG.ITEMS_BACKPACK):isEmpty()) then
Container.GoBack(CONFIG.ITEMS_BACKPACK)
end
end

anoyn
03-29-2019, 11:48 PM
Your not calling GoBack on a container object


In Container(CONFIG.ITEMS_BACKPACK):isEmpty()
Container(CONFIG.ITEMS_BACKPACK) makes the container, which you can call :isEmpty() on.

So do the same with :GoBack()

Like
Container(CONFIG.ITEMS_BACKPACK):GoBack()

7878952
03-30-2019, 06:50 PM
then it would be like that?

if (Container(CONFIG.ITEMS_BACKPACK):isEmpty()) then
Container(CONFIG.ITEMS_BACKPACK):GoBack()
end

7878952
03-30-2019, 08:29 PM
well I did this but it does not work

Module.New("backpack_back", function(moduleObject)
if (Container(CONFIG.ITEMS_BACKPACK):isFull() or Container(CONFIG.ITEMS_BACKPACK):isEmpty()) then
Container(CONFIG.ITEMS_BACKPACK):GoBack()
end
end)