dear @yahgiggle
Excuse me for the late reply !!! Your idea I found great and I have already been able to take over
thats cool now i can give you another idea oO lol
Code
local result = database:query("SELECT * FROM `prices` where `itemTypeID` = '"..item:getItemTypeID().."' and `TextureID` = '"..item:getTextureID().."' and `itemTypeName` = '"..item:getItemName().."' and `ChestID` = '"..serverchest:getChestID().."'");
local result = database:query("select `walletAmount` from `wallets` where `playerID` = "..OwnerID.."");
local result = database:query("select `walletAmount` from `wallets` where `playerID` = "..OwnerID.."");
local result = database:query("SELECT `OwnerID` FROM `chests` WHERE `ChestID` = '"..event.chestID.."'");
local result = database:query("select `walletAmount` from `wallets` where `playerID` = "..OwnerchestID.."");
local ReturnLabel = Gui:createLabel("You have successfully sold an " .. itempaid .. " Price $" .. price .. " per " .. rate .. " Total earnings =$" .. amount*price/rate .." id1 ".. item:getItemTypeID() .." id2 ".. item:getTextureID() .." Type "..item:getItemName().." ChestID "..serverchest:getChestID().."", 0.50, 0.01);
local ReturnLabel = Gui:createLabel("You have successfully sold an " .. itempaid .. " Price $" .. price .. " per " .. rate .. " Total earnings =$" .. amount*price/rate .." id1 ".. item:getItemTypeID() .." id2 ".. item:getTextureID() .." Type "..item:getItemName().." ChestID "..serverchest:getChestID().."", 0.50, 0.01);
this is my old lua script for charging users to take stuff from chests all chests can be owned by the player who place's them down , this means you can set the chests as trade chests heres my old code below to make the user the owner of the chest
Code
local result = database:query("SELECT * FROM `chests` WHERE `ChestID` = '"..event.chestID.."' AND `OwnerName` = '"..event.player:getName().."'");
database:queryupdate("INSERT INTO `chests` (`ChestID`, `OwnerName`, `OwnerID`) VALUES ('"..event.chestID.."', '"..event.player:getName().."', '"..event.player:getDBID().."')");
event.player:sendYellMessage("!!! All Chests are trade Chests !!! Chest id ="..event.chestID.." owner "..event.player:getName().."");
-- This event is triggered when the player deconstructs a chest (every object with storage [e.g. also kitchenettes] is considered as a chest).
event.player:sendYellMessage("!!! "..UserName.." you cannot do this "..OwnerName.." Owns this chest !!!");
-- This event is triggered when the player destroys a chest (every object with storage [e.g. also kitchenettes] is considered as a chest).
i hope this helps in some way or at lest gives you some ideas