Code: Select all
local tobuy = 20; -- buys 20 belts, i was assuming its a good count
local beltname = RoMScript("TEXT('Sys227502_name')") -- Excellent Belt, change to Sys202999_name when you want -- to buy random fusion stones
repeat
local beltcount = inventory:getItemCount(227502) -- number of belts you already have. Change id to 202999 for
--Random Fusion Stones
if beltcount >= tobuy then break end
player:openStore("Nebular"); -- or your npc that you want it to be
inventory:storeBuyItem(beltname, tobuy - beltcount)
yrest(3000)
until false