Skip to main content

bpt_basicneeds:onUse

AddEventHandler("bpt_basicneeds:onUse", type, prop_name)

This Event is triggered whenever a player Uses a food or drink item, it is used for displaying a prop in the players hands and playing the animation of the type used.

Arguments

ArgumentData TypeOptionalDefault ValueExplanation
TypestringNo-The Type of item used (either "food" or "drink")
Prop NamestringYes"prop_cs_burger_01" or "prop_ld_flow_bottle2The Prop To Use When Eating

Example


AddEventHandler("bpt_basicneeds:onUse", function(Type, prop_name)
if not prop_name then
prop_name = Type == "food" and "prop_cs_burger_01" or "prop_ld_flow_bottle2"
end
print(("Player Used Item! Type: %s. Prop: %s"):format(Type, prop_name))
end)