devon7600 Posted June 5, 2016 Share Posted June 5, 2016 Is there any way of making a certain item unequipable by certain characters if there is please tell me the code. thank Link to comment https://forums.kleientertainment.com/forums/topic/67920-making-clothes-unwearable/ Share on other sites More sharing options...
DarkXero Posted June 7, 2016 Share Posted June 7, 2016 AddPrefabPostInit("spear", function(inst) if not GLOBAL.TheWorld.ismastersim then return end inst:ListenForEvent("equipped", function(inst, data) local owner = data.owner if owner and owner:HasTag("player") and not owner:HasTag("specialguy") then owner:DoTaskInTime(0, function(owner) owner.components.inventory:GiveItem(inst) end) end end) end) This makes spears unequip from people that doesn't have the "specialguy" tag. Link to comment https://forums.kleientertainment.com/forums/topic/67920-making-clothes-unwearable/#findComment-780424 Share on other sites More sharing options...
NeddoFreddo Posted June 9, 2016 Share Posted June 9, 2016 @DarkXero Is there a way to make a whole item type unequippable by a character? (e.g. anything that goes in the character's headslot) Thanks for helping if you can! Link to comment https://forums.kleientertainment.com/forums/topic/67920-making-clothes-unwearable/#findComment-781433 Share on other sites More sharing options...
Aquaterion Posted June 9, 2016 Share Posted June 9, 2016 1 hour ago, NeddoFreddo said: @DarkXero Is there a way to make a whole item type unequippable by a character? (e.g. anything that goes in the character's headslot) Thanks for helping if you can! you do something similar but onto your character inst:ListenForEvent("equip", function(inst,data) if data.item.components.equippable.equipslot == EQUIPSLOTS.HEAD then inst:DoTaskInTime(0, function(inst) inst.components.inventory:GiveItem(data.item) end) end end) Link to comment https://forums.kleientertainment.com/forums/topic/67920-making-clothes-unwearable/#findComment-781472 Share on other sites More sharing options...
NeddoFreddo Posted June 10, 2016 Share Posted June 10, 2016 13 hours ago, Aquaterion said: you do something similar but onto your character inst:ListenForEvent("equip", function(inst,data) if data.item.components.equippable.equipslot == EQUIPSLOTS.HEAD then inst:DoTaskInTime(0, function(inst) inst.components.inventory:GiveItem(data.item) end) end end) So... character.lua? Link to comment https://forums.kleientertainment.com/forums/topic/67920-making-clothes-unwearable/#findComment-781740 Share on other sites More sharing options...
. . . Posted June 10, 2016 Share Posted June 10, 2016 (edited) 9 minutes ago, NeddoFreddo said: So... character.lua? ListenForEvents usually go in yourcharacter.lua prefab file in the masterpostinit section, I think ... Edited June 10, 2016 by SuperDavid Link to comment https://forums.kleientertainment.com/forums/topic/67920-making-clothes-unwearable/#findComment-781744 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