Tesumoto Posted November 5, 2018 Share Posted November 5, 2018 (edited) Hello everyone. I need to my code work only for those players who are in fight. When you fight with monsters / other players or when monsters / other players fight with you. Is possible to implement it? For this: AddComponentPostInit("playerspawner", function(PlayerSpawner, inst) inst:ListenForEvent("ms_playerdespawn", function (inst, player) if player and player.components.inventory and player.dontdrop ~= true then player.components.inventory:DropEverything(false,false) end end) end) I would be very grateful for your help, because I don't understand how to do it. Edited November 5, 2018 by Tezumoto Link to comment https://forums.kleientertainment.com/forums/topic/98007-condition-for-the-function/ Share on other sites More sharing options...
Lumina Posted November 5, 2018 Share Posted November 5, 2018 Maybe with the events "attacked" and "onattackother" ? Link to comment https://forums.kleientertainment.com/forums/topic/98007-condition-for-the-function/#findComment-1109305 Share on other sites More sharing options...
Tesumoto Posted November 5, 2018 Author Share Posted November 5, 2018 11 hours ago, Lumina said: Maybe with the events "attacked" and "onattackother" ? Create a second event or combine them? I just don't understand this. Link to comment https://forums.kleientertainment.com/forums/topic/98007-condition-for-the-function/#findComment-1109813 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