Jump to content

Recommended Posts

AddPrefabPostInit("axe",function(inst)	inst:AddComponent("fuel")	inst.components.fuel.fuelvalue = TUNING.SMALL_FUELend)

​It's ok for host. But clients still can't use that. They see an action "Add Fuel", and even can use axe on firepit, but action fails in a few seconds (no crash).

 

How to fix it? There is no fuel component on clients.

Standart initialization looks like that:

local function fn()	local inst = CreateEntity()	inst.entity:AddTransform()	inst.entity:AddAnimState()    inst.entity:AddNetwork()    MakeInventoryPhysics(inst)    inst.AnimState:SetBank(.....)    inst.AnimState:SetBuild(.....)    inst.AnimState:PlayAnimation("idle")    if not TheWorld.ismastersim then        return inst    end	.....	    inst:AddComponent("fuel")    inst.components.fuel.fuelvalue = TUNING.MED_FUEL	.....end

Link to comment
https://forums.kleientertainment.com/forums/topic/49060-custom-fuel/
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
×
  • Create New...