Log in

View Full Version : Need spears buy and spears refilll or check or help with bugged function



felipe93
05-23-2016, 01:14 AM
Hello Xeno community please someone help me with my bugged functions or give me a working one please

well the error is this when the char reachers the npc to buy spears open the trade channel to buy but when he going to buy them
the lua crashes giving me this error

21:18 XenoScript Error:
Script: VIDEO AULApall.lua
Line #: 3012
Chunk: ...s\USER\Desktop\Xenobot\Versions\..?Data?XB0024? 1.LUA
Error: attempt to perform arithmetic on local 'c' (a nil value)
This is an error with user-input and should not be reported as a bug with XenoBot.

the functions im using are these :
---------------------------------------------------------
local SpearMax = 7 --- How many spears to buy
local Spearmin = 2 --- When to leave
local SpearID = 3277 --- ID of spears
-------------------------------------------------------------------
if (labelName == "Check") then
Walker.ConditionalGoto((Self.Cap() <= MinCap) or
(Self.ItemCount(IDMana) < MinMana) or
((Self.ItemCount(SpearID) < Spearmin)) or
(Self.ItemCount(IDHealth) < MinHealth), "City", "Hunt")
---------------------------------------------------------------------------
elseif (labelName == "Ammo") then
Walker.Stop()
Self.SayToNpc({"Hi", "Trade"}, 65)
wait(1000,2000)
Self.ShopBuyItemsUpTo(SpearID, SpearsToBuy)
wait(1000, 2000)
Walker.Start()

thanks in advance