Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Free Itams
- Version 2.0.0
- By Mr Trala
- ]]
- config = {
- -- Config for PickUP module.
- itemID = {2854, 8828, 8829,
- 21747, 9697, 12803,
- 3154, 5785, 9222,
- 2856, 3580, 16129, 3232,
- 5785, 9586, 939,
- 20270, 2968, 5922,
- 942, 5953, 8764,
- 12724, 20138, 9586,
- 19216, 19218}, -- ItemIDs to be picked up
- containerName = "backpack", -- Ex. "Purple Backpack", "Backpack of holding", "Bag" etc
- CheckPOS = 1 -- The SQM from your character to check if theres an item.
- }
- x = config
- function PickUP()
- local p = Self.Position()
- local Cont = Container.New(x.containerName)
- if (Self.Cap() >= 1) then
- for y = -x.CheckPOS, x.CheckPOS do
- for x = -x.CheckPOS, x.CheckPOS do
- if table.contains(config.itemID, Map.GetTopUseItem(p.x + x, p.y + y, p.z).id) then
- Map.PickupItem(p.x+x, p.y+y, p.z, Cont:Index(), 0)
- end
- if (Cont:ItemCount() == Cont:ItemCapacity()) then
- local openAt = Cont:ItemCount() - 1
- if (Item.isContainer(Cont:GetItemData(openAt).id)) then
- Cont:UseItem(openAt, true)
- end
- end
- end
- end
- end
- end
- registerEventListener(TIMER_TICK, "PickUP")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement