Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Only copy once?

Asked by
Zerio920 285 Moderation Voter
9 years ago

I'm using a localscript to copy bricks from lighting into a new camera to turn them into local bricks. These act like the coins from Mario Bros., but the coins you got don't respawn after you die, meaning coins you haven't collected would still remain on stage, while coins you've collected are gone for good.

How can I make sure coins I've collected don't respawn, while the ones I have collected do?

0
I think I understand what you are saying. You want the coins that you have already collected not to be copied from Lighting when you respawn? If that is the case, I would try making a table of the bricks and only copying the bricks in the table. That way, when you collect a coin you can remove it from the table, causing it not to copy the next time. SanityMan 239 — 9y
0
And as I just realized you used the Data Persistence tag, I would like to add that you can save tables to Data Stores (which I would recommend) in JSON encoding. SanityMan 239 — 9y
0
Uh-huh, that makes sense. I'll try that. Haven't had much experience with tables before though so this'll be new to me. Zerio920 285 — 9y

Answer this question