SenL Posted January 29, 2015 Share Posted January 29, 2015 How do I make petals and petals_evil not perishable only if it's in mychar's inventory? Thanks!! Link to comment https://forums.kleientertainment.com/forums/topic/49925-how-to-make-petals-not-perishable-but/ Share on other sites More sharing options...
Maris Posted January 29, 2015 Share Posted January 29, 2015 What do you mean? Only your char inventory or specific char prefab? Link to comment https://forums.kleientertainment.com/forums/topic/49925-how-to-make-petals-not-perishable-but/#findComment-607348 Share on other sites More sharing options...
SenL Posted January 29, 2015 Author Share Posted January 29, 2015 If I add cutgrass.lua as a custom prefab and modify it (remove the perishable component), it works -- but won't it also affect all other characters as long as mychar is in that server? not sure. Link to comment https://forums.kleientertainment.com/forums/topic/49925-how-to-make-petals-not-perishable-but/#findComment-607415 Share on other sites More sharing options...
Kzisor Posted January 29, 2015 Share Posted January 29, 2015 You need to create a function which is called when you pick up an item, determine if it's petals and call the StopPerishing function like the birdcage does in ROG. Link to comment https://forums.kleientertainment.com/forums/topic/49925-how-to-make-petals-not-perishable-but/#findComment-607420 Share on other sites More sharing options...
Jjmarco Posted January 29, 2015 Share Posted January 29, 2015 Hm, maybe something like this?inst:ListenForEvent("itemget", function(inst, data) if inst.prefab == "You character's prefab here" and data.item.prefab:find("petals") then data.item.components.perishable:StopPerishing() endend)inst:ListenForEvent("itemlose", function(inst, data) if inst.prefab == "You character's prefab here" and data.item.prefab:find("petals") then data.item.components.perishable:StartPerishing() endend) Link to comment https://forums.kleientertainment.com/forums/topic/49925-how-to-make-petals-not-perishable-but/#findComment-607522 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