summaryrefslogblamecommitdiff
path: root/example/scripts/items/candy.lua
blob: a929d3f949d5b685e297cd8b2a1248180dc71a6a (plain) (tree)
1
2
3
4
5
6
7
8
9
10



                     
                                                                         




                                                                            
                                     

                              
                                   
    
--[[

 Example item script.

 Makes the player character say "*munch*munch*munch*" when using a candy.
 The HP regeneration effect is handled separately based on the heal value in
 items.xml.

--]]

local candy = get_item_class("candy")

candy:on("use", function(user)
    user:say("*munch*munch*munch*")
end)