Jump to content

Fueled:SetTakeFuelFn not working


Recommended Posts

I'm trying to have a function run when a yellow amulet is refuelled, however the function only runs when the world loads (before character spawned in) and doesn't run when the yellow amulet is refuelled. My code Is in the amulet.lua file, within the local function yellow() and is as follows:

inst.components.fueled:SetTakeFuelFn(print("yellow amulet was refuelled"))

I've checked the fuelled.lua file and looked at the Fueled:SetTakeFuelFn() function (seen below), which should set the ontakefuelfn value (though I don't know if this value even exists in the fuelled class), this value is later checked in the Fueled:TakeFuelItem() function, but always considers the ontakefuelfn value to be nil.

function Fueled:SetTakeFuelFn(fn)
    self.ontakefuelfn = fn
end

Is this just a dead function? Any help? Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...