Hello.
1. Equip SSA when X players on screen, and unequip when not
local PLAYERS = { 'Arkilys', 'Some other guy' }
local SSA_BP = 'red backpack' -- SSAs backpack.
local SSA_ID = 3081
local playersCount = paround(0, table.unpack(PLAYERS))
local neckItem = neck()
if playersCount > 0 and neckItem.id ~= SSA_ID then
moveitems(SSA_ID, 'neck', SSA_BP)
wait(100, 300)
elseif playersCount == 0 and neckItem.id == SSA_ID then
moveitems(SSA_ID, SSA_BP, 'neck')
wait(100, 300)
end
2. Equip MIGHT RING when X players on screen, and unequip when not
local PLAYERS = { 'Arkilys', 'Some other guy' }
local RING_BP = 'red backpack' -- Might rings backpack.
local RING_ID = 3048
local playersCount = paround(0, table.unpack(PLAYERS))
local item = finger()
if playersCount > 0 and item.id ~= RING_ID then
moveitems(RING_ID, 'finger', RING_BP)
wait(100, 300)
elseif playersCount == 0 and item.id == RING_ID then
moveitems(RING_ID, RING_BP, 'finger')
wait(100, 300)
end
3. Go to label when player on screen.
It's kinda confusing, because you say that you wanna stop cavebot but also go to 'byebye' label... If Cavebot is stopped, why going to 'byebye' label?
Anyway, changing waypoints by persistents is a bit tricky... Specially if you are using any refill script or if the player follows you AFTER the 'byebye' label, because the persistent would keep going back to 'byebye' label instead of letting Cavebot move to other waypoints.
So you must setup range of waypoints ids that the script should work. Example: You setup id 2 to 5 then the script will work only if you current wpt id is within that range.
local PLAYERS = { 'Arkilys', 'Some other guy' }
local WAYPOINT_LABEL = 'byebye' -- Waypoint label or index that it will go to when someone attacks you.
local WAYPOINT_RANGE = { Start = 2, End = 5 } -- Start and end ids of the waypoints that you must be. If your current wpt is not within that range then it will not go to WAYPOINT_LABEL when player appears.
if paround(0, table.unpack(PLAYERS)) then
local wpt = waypoint()
if wpt.id <= WAYPOINT_RANGE.Start and wpt.id >= WAYPOINT_RANGE.End then
stop()
gotolabel(WAYPOINT_LABEL)
end
end