Jump to content

Condition for the function


Recommended Posts

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 by Tezumoto
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...