Lazarus Posted December 6, 2017 Share Posted December 6, 2017 In light of what @@MagSul asked here: https://jkhub.org/topic/9647-preventing-player-death/ I was thinking of doing something simular (different concept), but make the player surrender if he only has 25% health. Is that even possible? I cant recall I ever even seen this, so this is just some mind spin of me. So in light, do an if - else check if player reached 25% health, if so, use script bladiebla.... edit: I saw //(BHVD) affect ( "Player", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_UNDYING", "DEFAULT" ); if ( $get( FLOAT, "SET_HEALTH")$, $=$, $1$ ) { run ( "end_duel" ); } } But can somebody explain to me, how the "get - set health = for example 25" makes sense? Arent you setting the health, or does this actually a health check? Link to comment
Ramikad Posted December 6, 2017 Share Posted December 6, 2017 In light of what @@MagSul asked here: https://jkhub.org/topic/9647-preventing-player-death/ I was thinking of doing something simular (different concept), but make the player surrender if he only has 25% health. Is that even possible? I cant recall I ever even seen this, so this is just some mind spin of me. So in light, do an if - else check if player reached 25% health, if so, use script bladiebla.... edit: I saw //(BHVD) affect ( "Player", /*@AFFECT_TYPE*/ FLUSH ) { set ( /*@SET_TYPES*/ "SET_UNDYING", "DEFAULT" ); if ( $get( FLOAT, "SET_HEALTH")$, $=$, $1$ ) { run ( "end_duel" ); } } But can somebody explain to me, how the "get - set health = for example 25" makes sense? Arent you setting the health, or does this actually a health check? In theory the GET command takes the affected entity's specific value (in this case, its health) instead than setting it. I don't know if it's actually the case, but I think (SET_HEALTH,"X") pretty much equals to health = X. (GET(SET_HEALTH)) would be equivalent to "get health value". I can't really give a better explanation right now, and if that doesn't make any sense it's probably because I'm completely drunk right now Lazarus likes this Link to comment
Noodle Posted December 6, 2017 Share Posted December 6, 2017 What that script is saying is that if the player has health equals to 1 (set_health = 1), then the script "end_duel" will be activated. The main problem with it, is that it'd only check that value only once when said script is activated. You'd need to activate the script constantly to check if the player has reached that amount of health. Here's what I'd do to make a script get activated when the player reaches less than 25 points of health. First, I'd create the script that tells the player to run a script if he has less than 26 points of health. affect ( "player", INSERT ) // affects the player. INSERT doesn't stop the previous script { if ( $get( FLOAT, "SET_HEALTH" ) < 26.000$ ) // if the player has less than 26 HP { affect ( "player", FLUSH ) // affects this player. FLUSH makes it so the other script stops working { wait ( 1000.000 ); // wait 1 second run ( "end_duel" ); // this runs the script end_duel.ibi located in 'scripts' folder. } } else ( ) // if the player hasn't reached less than 26 HP { wait ( 1000.000 ); // wait 1 second } } After that, I'd create another script that runs the first one every 5 seconds. This way, it'll constantly check if the player has less than 26 HP instead of just doing it once. loop ( -1.000 ) // this is an infinite loop { wait ( 5000.000 ); // wait 5 seconds run ( "test/health_test" ); // run the first script } I think this should do it. Lazarus likes this Link to comment
Lazarus Posted December 6, 2017 Author Share Posted December 6, 2017 Thanks for the explination, i am a bit rusty back in behaved i am just trying to check what conditional values I can use for events Link to comment
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