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.

thomas4845

need help coding

Recommended Posts

thomas4845    36

right now i'n trying to replace a texture for a weapon, like a weapon that changes how it looks throughout durability ; does anyone know how to change an items texture , any help would be awesome thnx

 

Share this post


Link to post
Share on other sites
BakaSchwarz    32

Is it only the looks? Or do you want to change abilities as well? In that case you may want to just create different prefabs for each "stage" of your weapon and swap them when needed. Anyways: Look at abigail_flower.lua as this is probably a perfect example of the thing you want to accomplish. As for detecting the change of durability/usages, you may want to look into the event "percentusedchange". You can just listen to it like so:

    inst:ListenForEvent("percentusedchange", function(inst, data)
		print(data.percent)
	end)

 

Share this post


Link to post
Share on other sites