Author Topic: Coins at checkpoint: work-around exploit?  (Read 1608 times)

LyndsWins

  • Level 2: Gruppy
  • *
  • Posts: 21
    • View Profile
Coins at checkpoint: work-around exploit?
« on: December 14, 2018, 11:08:58 PM »
I was wondering if there is a way to set the player's coins back to what they were at the last checkpoint.
Right now, if I hit a checkpoint with 10 coins, go collect 50 more coins and then die, then I respawn at the checkpoint with 60 coins, and I can go collect all those coins again for a total of 110. Depending on how many lives I have, I can exploit the system and get super rich too quickly lol.

Is there some code I can put into the looping section to fix it?
"Homo sum, humani nihil a me alienum puto. I am human: nothing human is alien to me." - Terence

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Coins at checkpoint: work-around exploit?
« Reply #1 on: December 14, 2018, 11:41:06 PM »
Hmm... I don't think you can do this.

LyndsWins

  • Level 2: Gruppy
  • *
  • Posts: 21
    • View Profile
Re: Coins at checkpoint: work-around exploit?
« Reply #2 on: December 15, 2018, 12:28:00 AM »
okie dokie. Thanks anyway :)
"Homo sum, humani nihil a me alienum puto. I am human: nothing human is alien to me." - Terence

TingThing

  • Admin and Developer
  • Level 20: Nobom
  • *
  • Posts: 1395
  • Creator and Developer of Platform Builder
    • View Profile
    • Platform Builder Home
Re: Coins at checkpoint: work-around exploit?
« Reply #3 on: December 15, 2018, 06:55:18 AM »

I can think of a few ways to make this work...

You could create your own coins as a custom item and set it to permanent. That would be one way to do it, but keep in mind that those coins will never come back, even if you replay the course.


Another possibility would be to save the coin value to a variable using a command block that you pass as you hit the checkpoint. Then, when the character dies, run a command which resets the coins to that variable (there's a "death" command prompt from the character commands in character settings of game setup.)

CGM

  • Christian, 3D artist, former Platform Builder gamdev
  • Master Builder
  • *
  • Posts: 3836
    • View Profile
Re: Coins at checkpoint: work-around exploit?
« Reply #4 on: December 15, 2018, 12:22:33 PM »
Why didn't I think of that!