Jump to content

Recommended Posts

I feel like I'm doing this the wrong way. Well I know I'm doing this the wrong way really. I've had success modifying prefabs postinit but no luck with components.

 

function Please(inst)

local Lighter = Class(function(self, inst)
    self.inst = inst

    --V2C: Recommended to explicitly add tag to prefab pristine state
    inst:AddTag("lighter")

    self.onlight = nil
end)
 
function Lighter:Light(target)
     if self.shadowlight == true then 
	 
	 else
    if target.components.burnable ~= nil and not (target:HasTag("fueldepleted") or target:HasTag("INLIMBO")) then
      target.components.burnable:Ignite()
	 


end
end
end
end

AddComponentPostInit("lighter", Please)

I'm trying to change the Light function from the component Lighter but
I really have no idea the proper method of changing a components function.

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
×
  • Create New...