Modme Forums
Menu:

A question about level.stuff

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: TrueGamerCalls
My question is how to minus what a current level.something? This is what I tried so far, which the teleporter script works correctly, I'm even able to play a sound after the waitill trigger and it will work, but for whatever reason this doesn't work. I tried debugging and it doesn't seem to do anything and its not the scripts I'm using it for.

// I modifed the teleporter script from unitownpapi (forgot his name) to minus 
// level.hearts by one
function player_teleport()
{
  destination = GetEnt( self.target, "targetname" );
  while(1)
  {
    self waittill( "trigger", player );
    level.hearts --; // This is what I've tried
    player SetOrigin( destination.origin );
    player SetPlayerAngles( destination.angles );
  }
}


ModmeBot:

Reply By: Harry Bo21

TrueGamerCalls
My question is how to minus what a current level.something? This is what I tried so far, which the teleporter script works correctly, I'm even able to play a sound after the waitill trigger and it will work, but for whatever reason this doesn't work. I tried debugging and it doesn't seem to do anything and its not the scripts I'm using it for. // I modifed the teleporter script from unitownpapi (forgot his name) to minus // level.hearts by one function player_teleport() { destination = GetEnt( self.target, "targetname" ); while(1) { self waittill( "trigger", player ); level.hearts --; // This is what I've tried player SetOrigin( destination.origin ); player SetPlayerAngles( destination.angles ); } }

that code is correct, but you would need to make sure you have "initialised" level.hearts "first"


level.hearts = 1;


you should check if its even finding that entity

e_entity = getEnt( self.target, "targetname" );

iPrintLnBold( "FOUND ENTITY? : " + isDefined( e_entity ) );



and its "up town papi..."


ModmeBot:

Reply By: TrueGamerCalls

Harry Bo21
TrueGamerCalls My question is how to minus what a current level.something? This is what I tried so far, which the teleporter script works correctly, I'm even able to play a sound after the waitill trigger and it will work, but for whatever reason this doesn't work. I tried debugging and it doesn't seem to do anything and its not the scripts I'm using it for. // I modifed the teleporter script from unitownpapi (forgot his name) to minus // level.hearts by one function player_teleport() { destination = GetEnt( self.target, "targetname" ); while(1) { self waittill( "trigger", player ); level.hearts --; // This is what I've tried player SetOrigin( destination.origin ); player SetPlayerAngles( destination.angles ); } } that code is correct, but you would need to make sure you have "initialised" level.hearts "first" level.hearts = 1; you should check if its even finding that entity e_entity = getEnt( self.target, "targetname" ); iPrintLnBold( "FOUND ENTITY? : " + isDefined( e_entity ) ); and its "up town papi..."

EDIT: I tested it out and it didn't show the debugging text. Don't know what to do. I put a trigger use somewhere to test it out and I was able to minus the level.hearts that way, but the way I'm trying to do it is not working. I did put my own debugging test and I got it to work, so its just not removing any level.hearts


ModmeBot:

Reply By: Harry Bo21

TrueGamerCalls
Harry Bo21 TrueGamerCalls My question is how to minus what a current level.something? This is what I tried so far, which the teleporter script works correctly, I'm even able to play a sound after the waitill trigger and it will work, but for whatever reason this doesn't work. I tried debugging and it doesn't seem to do anything and its not the scripts I'm using it for. // I modifed the teleporter script from unitownpapi (forgot his name) to minus // level.hearts by one function player_teleport() { destination = GetEnt( self.target, "targetname" ); while(1) { self waittill( "trigger", player ); level.hearts --; // This is what I've tried player SetOrigin( destination.origin ); player SetPlayerAngles( destination.angles ); } } that code is correct, but you would need to make sure you have "initialised" level.hearts "first" level.hearts = 1; you should check if its even finding that entity e_entity = getEnt( self.target, "targetname" ); iPrintLnBold( "FOUND ENTITY? : " + isDefined( e_entity ) ); and its "up town papi..." EDIT: I tested it out and it didn't show the debugging text. Don't know what to do. I put a trigger use somewhere to test it out and I was able to minus the level.hearts that way, but the way I'm trying to do it is not working. I did put my own debugging test and I got it to work, so its just not removing any level.hearts

you also had a space between "level.hearts" and the "--"

thats not how this operator works


var--; // yes
var --; // no

var -= 1; // yes

var = var - 1; // yes


ModmeBot:

Reply By: TrueGamerCalls

Harry Bo21
TrueGamerCalls Harry Bo21 TrueGamerCalls My question is how to minus what a current level.something? This is what I tried so far, which the teleporter script works correctly, I'm even able to play a sound after the waitill trigger and it will work, but for whatever reason this doesn't work. I tried debugging and it doesn't seem to do anything and its not the scripts I'm using it for. // I modifed the teleporter script from unitownpapi (forgot his name) to minus // level.hearts by one function player_teleport() { destination = GetEnt( self.target, "targetname" ); while(1) { self waittill( "trigger", player ); level.hearts --; // This is what I've tried player SetOrigin( destination.origin ); player SetPlayerAngles( destination.angles ); } } that code is correct, but you would need to make sure you have "initialised" level.hearts "first" level.hearts = 1; you should check if its even finding that entity e_entity = getEnt( self.target, "targetname" ); iPrintLnBold( "FOUND ENTITY? : " + isDefined( e_entity ) ); and its "up town papi..." EDIT: I tested it out and it didn't show the debugging text. Don't know what to do. I put a trigger use somewhere to test it out and I was able to minus the level.hearts that way, but the way I'm trying to do it is not working. I did put my own debugging test and I got it to work, so its just not removing any level.hearts you also had a space between "level.hearts" and the "--" thats not how this operator works var--; // yes var --; // no var -= 1; // yes var = var - 1; // yes

Yeah I tried with the var stuff and it did work under other things but not the teleport trigger which is a trigger multiple. I'm able to put a PlaySound or a IPrintLN and it will work, but not level.hearts--; I'm honestly stumped at what to do now, I feel so dumb right now...


ModmeBot:

Reply By: Harry Bo21
...

reread my answer...


ModmeBot:

Reply By: TrueGamerCalls

Harry Bo21
... reread my answer...

I'm sorry, I must be missing something then. By variable do you mean the level.hearts or something = GetEnt(something, "targetname")? I tried both of these, putting level.hearts in place of the "something" without the quotes. And I fixed the space thing too, sorry if I am wasting your time, but may you please elaborate more?