Hello there! im having some trouble getting this script to work, what am I doing wrong? didnt really understand what to do just paste it into my "hunting script"?
Walker.Stop()
wait(800,1600)
if Map.GetTopUseItem(32190, 32432, 8).id == 1632 then --- checks the id of the locked door
useKeyOnDoor(2968, 32190, 32432, 8) --- opens if locked.
wait(400,600)
Walker.Start()
else
if not Map.IsTileWalkable(32190, 32432, 8) then Self.UseDoor(32190, 32432, 8) --- opens door if unlocked
Walker.Start()
end
Walker.Start() ---- If door is neither locked or closed it'll just go to the next node and walk through it
end
function useKeyOnDoor(keyID, x, y, z) --- from forgee's library
local Cont = Container.New(0) -- check in main backpack (index is 0)
if Cont:CountItemsOfID(keyID) > 0 then
for s = 0, Cont:ItemCount() do --find specific itemid spot
local item = Cont:GetItemData(s)
if item.id == keyID then
Cont:UseItemWithGround(s, x, y, z)
end
end
end
end