Hey, here's my old quest to prevent switch bot:
After add the quest to server
Go to item_proto client/server
Search for 71084, copy the line
Then change only the ID's you put in the quest.
The name can be the same in all, just change the ID's
You need to give path in item_list and item_desc, just change the ID's.
Kind Regards
Code:
quest switch begin
state start begin
function switchItem()
local a = number(1, 10) -- set here how much ids you want
local item_list = {X,X,X,X,X,X,X,X,X,X} -- if you set more than 10 in top then you need to add here
local give = true
for k,v in ipairs(item_list) do
if pc.count_item(v) >= 1 then
give = false
end
end
if give == false or pc.get_empty_inventory_count() < 1 then
say_title("Title")
say("")
say_reward("Message error for dont have more than 1 pack on inventory")
return
end
setskin(NOWINDOW)
pc.give_item2(item_list[a], 50) -- you can set here the quantity of received item
end
when X.use begin -- dont forget to set here a NPC or item
switch.switchItem()
end
end
end
Go to item_proto client/server
Search for 71084, copy the line
Then change only the ID's you put in the quest.
The name can be the same in all, just change the ID's
You need to give path in item_list and item_desc, just change the ID's.
Kind Regards