Platform Builder Forums
Help and Support => Working with Platform Builder => Topic started by: LyndsWins 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?
-
Hmm... I don't think you can do this.
-
okie dokie. Thanks anyway :)
-
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.)
-
Why didn't I think of that!