Cunning fox Posted December 1, 2016 Share Posted December 1, 2016 (edited) I need to make mod, that will add tag like ("StillAlive") when player spawns, and when player dies, remove it, and add tag ("dead"). If someone'll help, I'll give him skin Edited December 1, 2016 by makar5000 1 Link to comment Share on other sites More sharing options...
PanAzej Posted December 1, 2016 Share Posted December 1, 2016 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 More sharing options...
Cunning fox Posted December 1, 2016 Author Share Posted December 1, 2016 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!) 1 Link to comment Share on other sites More sharing options...
PanAzej Posted December 1, 2016 Share Posted December 1, 2016 What is your mod about, then? When you die in wilderness your character is basically deleted and doesn't exist when dead, so why check if it isn't alive? Link to comment Share on other sites More sharing options...
Cunning fox Posted December 1, 2016 Author Share Posted December 1, 2016 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. 1 Link to comment Share on other sites More sharing options...
PanAzej Posted December 1, 2016 Share Posted December 1, 2016 (edited) 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 December 1, 2016 by PanAzej Link to comment 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