Milllk 59 Report post Posted September 20, 2015 i try to use the addcomponentpostinit but it does not work. local function ChangeMoleShader (inst) print("it work") local OLD_CUBES = NIGHTVISION_COLOURCUBES local GHOSTVISION_COLOURCUBES = { day = "images/shader/purple_moon_cc.tex", dusk = "images/shader/purple_moon_cc.tex", night = "images/shader/purple_moon_cc.tex", full_moon = "images/shader/purple_moon_cc.tex", } print("work") return instendAddComponentPostInit("playervision",ChangeMoleShader) Share this post Link to post Share on other sites
Mr. Tiddles 1154 Report post Posted September 20, 2015 The answers you seek lie within the hats.lua prefab, located in the scripts-prefabs folder, my child. What I mean is, the colourcube override is in the onequip/onunequip functions in the hat.lua. What you'd wanna do is make a prefab postinit for the molehat itself. Adding a function something like this in said postinit: inst.components.equippable:SetOnEquip( function(inst)DO THINGYend) And as for what thingy to do? You'll find your clues in the hat.lua.An unequip would be uneeded, as it already just removes the colour cube and night vision. Share this post Link to post Share on other sites
Milllk 59 Report post Posted September 20, 2015 the molehat has a tag nightvision which provides the vision effect,it can't be change during equip or unequip,it rely on the inst itself inst:AddTag("nightvision") like this, so i add the tag ,but can't change the color,i guess if i can find where nightvision is defined,i will be fine for modifying. ill try what u've told. Share this post Link to post Share on other sites