Well I use Alois's Shop System in my Mod quite a lot. Thxs to Alois I now can set up different Shops with different items to sell to the player. I would all so like to thank him for this bit of Coding.
What I have done here is just cloned a Snail and put Random Money on the snail, so when the player kills the snail they will receive Gold for the Shop to spend.
cloneObject{
name = "snail_gold",
baseObject = "snail",
onDie = function(self)
local money = math.random(1,5) -- Value can be changed to your liking --
gui.globalVars["totalMoney"] = gui.globalVars["totalMoney"] + money
hudPrint("Gained " .. money .. " Gold pieces.")
return true
end
}
Of course this is just an example. but thanks to Alois I now can reward the Player with Gold for the shop for certain Monster deaths, or all the monsters they kill. I thinks it's cool and I hope you do to..