I need a script with when my spears over the character ignore the monsters and go to the X waypoint (But this script need to be atived in all cavebot time, and not in only a Action Waypoint) understand? Sorry for my bad english
I need a script with when my spears over the character ignore the monsters and go to the X waypoint (But this script need to be atived in all cavebot time, and not in only a Action Waypoint) understand? Sorry for my bad english
Try adding this on your scripter
don't forget to change "Monster" in each setting for the monsters on your script
local ammo = "spear"
local amount_ammo = 3
auto(200)
if itemcount(ammo) <= amount_ammo then
setsetting('Targeting/Creatures/Monster/Setting1/OnlyIfTrapped', 'yes')
setsetting('Targeting/Creatures/Monster/Setting1/OnlyIfTrapped', 'yes')
setsetting('Targeting/Creatures/Monster/Setting1/OnlyIfTrapped', 'yes')
else
setsetting('Targeting/Creatures/Monster/Setting1/OnlyIfTrapped', 'no')
setsetting('Targeting/Creatures/Monster/Setting1/OnlyIfTrapped', 'no')
setsetting('Targeting/Creatures/Monster/Setting1/OnlyIfTrapped', 'no')
end
(sorry for bad english)
And if i use this? will works fine with what i need?
local ammo = "royal spear"
local amount_ammo = 5
auto(200)
if itemcount(ammo) <= amount_ammo then
set('Targeting/Enabled', 'yes')
else
set('Targeting/Enabled', 'no')
end
Just a tip, add a table instead of writing onto every line
local ammo = "royal spear"
local amount_ammo = 3
local monsters = "Rat", "Cave Rat", "Bug"
auto(200)
if itemcount(ammo) <= amount_ammo then
for _, v in ipairs(monsters) do
setsetting('Targeting/Creatures/' .. v .. '/Setting1/OnlyIfTrapped', 'yes')
end
else
for _, v in ipairs(monsters) do
setsetting('Targeting/Creatures/' .. v .. '/Setting1/OnlyIfTrapped', 'no')
end
end
Well, if you get trapped you'll die cus targeting is off.
Error using the croix script /\
error in Persistent script NewPersistentScript1:
[" for _, v in ipairs(monster..."]:NewPersistentScript1:10 bad argument #1 to 'ipairs' (table expected, got string)
stack traceback:
[" for _, v in ipairs(monsters) do"]:NewPersistentScript1:10 in user script
@Felipex change for this.
PHP Code:
local monsters = {"Rat", "Cave Rat", "Bug"}
Now dont have errors but i cant test now, but thanks if are right.
If dont work i repply, rep to all