samuel789 Posted September 20, 2018 Share Posted September 20, 2018 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 More sharing options...
samuel789 Posted September 21, 2018 Author Share Posted September 21, 2018 Solved! Nevermind, I wasn't posing the print command as a function like so: inst.components.fueled:SetTakeFuelFn(function() print("yellow amulet was refuelled") end) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now