hummelchen Posted May 13, 2015 Share Posted May 13, 2015 Hii want to dissable the healingssalve.the plan is, my character can put it in the inventory, but he should not be able to use it anymore Link to comment https://forums.kleientertainment.com/forums/topic/53916-deactivate-items/ Share on other sites More sharing options...
DarkXero Posted May 13, 2015 Share Posted May 13, 2015 Put this in modmain:AddPrefabPostInit("healingsalve", function(inst) local old = inst.components.healer.Heal inst.components.healer.Heal = function(self, target) if target.prefab == "wilson" then return false end return old(self, target) endend)and replace wilson with your character's prefab name. We override the healer component of the healing salve, especifically, to disable the heal function when used on your character. Link to comment https://forums.kleientertainment.com/forums/topic/53916-deactivate-items/#findComment-637317 Share on other sites More sharing options...
hummelchen Posted May 14, 2015 Author Share Posted May 14, 2015 oh man, so far away from my own skills. it works thank you Link to comment https://forums.kleientertainment.com/forums/topic/53916-deactivate-items/#findComment-637463 Share on other sites More sharing options...
hummelchen Posted June 23, 2015 Author Share Posted June 23, 2015 Put this in modmain:AddPrefabPostInit("healingsalve", function(inst) local old = inst.components.healer.Heal inst.components.healer.Heal = function(self, target) if target.prefab == "wilson" then return false end return old(self, target) endend)and replace wilson with your character's prefab name. We override the healer component of the healing salve, especifically, to disable the heal function when used on your character. Hey. My character is finish now and i played some game, now i got a bug.if i host the game and a client pick my char, his game will crash if a healingssalve drops somewhere."Nil value expected" why? Link to comment https://forums.kleientertainment.com/forums/topic/53916-deactivate-items/#findComment-649350 Share on other sites More sharing options...
hummelchen Posted June 23, 2015 Author Share Posted June 23, 2015 the character is iceman, upload him today, if u want to try it by yourself.you can also use spidergland, i used the same code for this item.let someone else host and pick iceman and drop a spidergland --> bug Link to comment https://forums.kleientertainment.com/forums/topic/53916-deactivate-items/#findComment-649354 Share on other sites More sharing options...
DarkXero Posted June 23, 2015 Share Posted June 23, 2015 (edited) AddPrefabPostInit("healingsalve", function(inst) if not GLOBAL.TheWorld.ismastersim then return end local old = inst.components.healer.Heal inst.components.healer.Heal = function(self, target) if target.prefab == "wilson" then return false end return old(self, target) endend)@hummelchen Edited June 23, 2015 by DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/53916-deactivate-items/#findComment-649357 Share on other sites More sharing options...
hummelchen Posted June 23, 2015 Author Share Posted June 23, 2015 and again, thank you Link to comment https://forums.kleientertainment.com/forums/topic/53916-deactivate-items/#findComment-649396 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now