Jump to content

On spawn tag


Recommended Posts

You could just check health component/health_replica for values or functions, e.g. if inst.components.health:IsDead() then something happens end

Or make eventlisteners, e.g. inst:ListenForEvent("death", function() something_happens_here end)

Basically check health component.

As for tags, you can check if player has tag "playerghost". If they don't have it, they're most probably alive.

Link to comment
Share on other sites

Just now, PanAzej said:

You could just check health component/health_replica for values or functions, e.g. if inst.components.health:IsDead() then something happens end

Or make eventlisteners, e.g. inst:ListenForEvent("death", function() something_happens_here end)

Basically check health component.

As for tags, you can check if player has tag "playerghost". If they don't have it, they're most probably alive.

I can't do it with ghos because of wilderness mode on my server, but thanks! (Oh my god, it's Default!)

  • Like 1
Link to comment
Share on other sites

4 minutes ago, PanAzej said:

You could just check health component/health_replica for values or functions, e.g. if inst.components.health:IsDead() then something happens end

Or make eventlisteners, e.g. inst:ListenForEvent("death", function() something_happens_here end)

Basically check health component.

As for tags, you can check if player has tag "playerghost". If they don't have it, they're most probably alive.

I'm making my own PvP server. There's a problem, when player leaves game while fight. I'm trying to make mod, that leaves his body at server, and (If it kiled) kills coward.

  • Like 1
Link to comment
Share on other sites

6 minutes ago, makar5000 said:

Hm, not working


attempt to index global 'inst' (a nil value)

 

Of course it doesn't. I thought you're making your own character and you need code to put inside your prefab.

The thing you're trying to do is a bit hard to achieve. You'll have to edit code about the gamemode itself or some kind of player spawner or player_common, not sure (I have to go really soon, no time to check).

Or you could spawn a "dummy" on player disconnect that takes damage and can die, but I'm not sure if this workaround here isn't a bit excessive.

Isn't a mod similar to your idea somewhere on the workshop, though?

Edited by PanAzej
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...