Rionxp Posted August 28, 2020 Share Posted August 28, 2020 Hello. I currently have a small problem with my character. It's not important but slightly annoying. First of all, my character has a hat and even after dying he keeps his hat. So far so good. The only problem is, if the character dies while wearing the hat, then gets resurrected the hat becomes invisible. It's still equipped but it isn't shown on my character. Is there maybe a line that could auto unequip-equip right after resurrecting? Thanks in advance Link to comment https://forums.kleientertainment.com/forums/topic/121316-hat-becomes-invisible-after-resurrection/ Share on other sites More sharing options...
DecDuck Posted August 28, 2020 Share Posted August 28, 2020 (edited) You could somehow reload the animation because you probably don't need to unequip-equip after resurrecting. (Also, are you playing with the no-drop mod? Because you should drop the hat.) Edited August 28, 2020 by decduck3 Link to comment https://forums.kleientertainment.com/forums/topic/121316-hat-becomes-invisible-after-resurrection/#findComment-1366872 Share on other sites More sharing options...
Rionxp Posted August 28, 2020 Author Share Posted August 28, 2020 11 hours ago, decduck3 said: You could somehow reload the animation because you probably don't need to unequip-equip after resurrecting. (Also, are you playing with the no-drop mod? Because you should drop the hat.) No the things is, I don't want him to drop the hat. I want him to keep it after resurrecting. How do I reload the animation? Link to comment https://forums.kleientertainment.com/forums/topic/121316-hat-becomes-invisible-after-resurrection/#findComment-1367093 Share on other sites More sharing options...
DecDuck Posted August 28, 2020 Share Posted August 28, 2020 (edited) Should work: --unequip local skin_build = inst:GetSkinBuild() if skin_build ~= nil then owner:PushEvent("unequipskinneditem", inst:GetSkinName()) end owner.AnimState:ClearOverrideSymbol("swap_hat") owner.AnimState:Hide("HAT") owner.AnimState:Hide("HAIR_HAT") owner.AnimState:Show("HAIR_NOHAT") owner.AnimState:Show("HAIR") if owner:HasTag("player") then owner.AnimState:Show("HEAD") owner.AnimState:Hide("HEAD_HAT") end --equip local skin_build = inst:GetSkinBuild() if skin_build ~= nil then owner:PushEvent("equipskinneditem", inst:GetSkinName()) owner.AnimState:OverrideItemSkinSymbol("swap_hat", skin_build, symbol_override or "swap_hat", inst.GUID, fname) else owner.AnimState:OverrideSymbol("swap_hat", fname, symbol_override or "swap_hat") end owner.AnimState:Show("HAT") owner.AnimState:Show("HAIR_HAT") owner.AnimState:Hide("HAIR_NOHAT") owner.AnimState:Hide("HAIR") if owner:HasTag("player") then owner.AnimState:Hide("HEAD") owner.AnimState:Show("HEAD_HAT") end You are effectively equipping and unequip, but just the animation. Edited August 28, 2020 by decduck3 Link to comment https://forums.kleientertainment.com/forums/topic/121316-hat-becomes-invisible-after-resurrection/#findComment-1367121 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