Jump to content

Mod Coding help, punching with fire


Zimzagoon

Recommended Posts

One of my characters perks is when theyre half health or lower, and they arent holding any weapons, their punches should set things on fire the same way torches do when you attack with them.  Ive searched through every game files i could that would help me but i dont know how to properly string together a function that works. Every time i try to load the mod the game  freezes  so obviously im not doing it right. Appreciate any help!

Link to comment
Share on other sites

This was written from memory and on a phone, so only use it a guide :p

In your character's main function, put the following

inst:ListenForEvent("onhitother", function(inst, data) if inst.components.health and inst.components.health:GetPercent() <= 0.5 and not (inst.components.inventory and inst.components.inventory:GetEquippedItem("hands")) then

if data and data.target and data.target.components.burnable then

data.target.components.burnable:Ignite()

end end end)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...