I have been using the basic built in system, but I decided to go the real tibia route and make it to where you can't loot a quest container unless you have the proper cap and inventory space to do so.
I'm not extremely familiar with scripting but I have done quite a bit of scripting by piecing together various scripts plus some of my own (Almost all quests finished for tibia 7.72
). Anyways, I have been using my functions.lua as a major reference when creating my own scripts, and so I was easily able to adapt one for checking player cap, and then displaying an error message just like old tibia.
The section that says "you do not have enough space" will be where this code will go.
Everything else works fine for me, do you guys have any places I should start? I've been searching the forums and most solutions aren't really geared towards me and they all contain a lot of variable declarations that I would need help with.
I'm not exactly asking for a complete solution (though I won't deny one either!) but I would love if you guys could help me find a place to start. I was kind of hoping there was an easy path to these, because I don't want to do anything crazy with the script. I thought I could use getcontainercap or something, I dunno.
Thanks for reading!
(Also if my code is garbage, let me know, it is mostly from Nottinghster though I believe.)
I'm not extremely familiar with scripting but I have done quite a bit of scripting by piecing together various scripts plus some of my own (Almost all quests finished for tibia 7.72

Code:
-- Script by Nottinghster
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 10007 then
queststatus = getPlayerStorageValue(cid,10007)
if queststatus == -1 and getPlayerFreeCap(cid) > getItemWeightById(2170, 1) then
doPlayerSendTextMessage(cid,22,"You have found a silver amulet.")
doPlayerAddItem(cid, 2170, 1)
setPlayerStorageValue(cid,10007,1)
elseif queststatus == -1 and getPlayerFreeCap(cid) > getItemWeightById(2170, 1) then
doPlayerSendTextMessage(cid,22,"You do not have enough space.")
elseif queststatus == -1 and getPlayerFreeCap(cid) < getItemWeightById(2170, 1) then
doPlayerSendTextMessage(cid,22,"You have found a silver amulet weighing " .. getItemWeightById(2170, 1) .. " oz. It is too heavy.")
elseif queststatus == 1 then
doPlayerSendTextMessage(cid,22,"The chest is empty.")
end
end
return true
end
The section that says "you do not have enough space" will be where this code will go.
Everything else works fine for me, do you guys have any places I should start? I've been searching the forums and most solutions aren't really geared towards me and they all contain a lot of variable declarations that I would need help with.
I'm not exactly asking for a complete solution (though I won't deny one either!) but I would love if you guys could help me find a place to start. I was kind of hoping there was an easy path to these, because I don't want to do anything crazy with the script. I thought I could use getcontainercap or something, I dunno.
Thanks for reading!
(Also if my code is garbage, let me know, it is mostly from Nottinghster though I believe.)