ModmeDTZxPorter: Goodbye

New Modme platform coming soon!
A question about level.stuff
Viewed 598 time(s)
Topic created on 1515718293
Original post
Modme User
15 wins

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 );
  }
}

I quit modding, but I'll keep my assets up for downloads...

TGC Mod Template
Reply #1 on 1515722640
Modme User
136 wins

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..."


HarryBo21's BO3 Perks v2.2.1
LINK TO MODME POST
FX Library v1.0.2
LINK TO MODME POST
Black Ops 3 Gun Pack v2.4.1
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST
Reply #2 on 1515843555
Modme User
15 wins

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


I quit modding, but I'll keep my assets up for downloads...

TGC Mod Template
Reply #3 on 1515847229
Modme User
136 wins

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

HarryBo21's BO3 Perks v2.2.1
LINK TO MODME POST
FX Library v1.0.2
LINK TO MODME POST
Black Ops 3 Gun Pack v2.4.1
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST
Reply #4 on 1515864462
Modme User
15 wins

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...


I quit modding, but I'll keep my assets up for downloads...

TGC Mod Template
Reply #5 on 1515905261
Modme User
136 wins

...

 

reread my answer...


HarryBo21's BO3 Perks v2.2.1
LINK TO MODME POST
FX Library v1.0.2
LINK TO MODME POST
Black Ops 3 Gun Pack v2.4.1
LINK TO MODME POST
Black Ops 3 Napalm Zombie v3.0.1
LINK TO MODME POST
Black Ops 3 Shrieker Zombie v3.0.1
LINK TO MODME POST
Reply #6 on 1515920063
Modme User
15 wins

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?


I quit modding, but I'll keep my assets up for downloads...

TGC Mod Template