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

How would I make it so that I collect an item only once?

Asked by
yelsew 205 Moderation Voter
9 years ago

I am trying to do a recreation of Super Mario 64 and such, but in a ROBLOX way. Not copying any levels, but I have absolutely no idea how I would even start to create a coin system, in which certain coins could only be collected once. So they can't be farmed. I was thinking about doing either...

-A system where each coin has a name, and basically doing a coin check function I decided this is too much code for something that should be relatively simple -A system where each coin code has a specific booltag, and that booltag can be changed through DataStores This system might ruin it for others, which would make the game impossible, since I want it to be multiplayer. And too many booltags to change. -A system in which the player would have a coin booltag for each coin, and every coin would change that booltag to true if it was collected. This system would have worked the best, except that there are probably going to be quite a few coins for each level and I don't feel like putting in a booltag for each coin.

Can someone guide me in the right direction please? I am truly stumped.

1 answer

Log in to vote
0
Answered by 9 years ago

If you wanted to make the coins only visible to players who haven't collected them, you could use local parts. If you did that, you'd have to make invisible dummy coins as normal parts, because local parts don't interact with normal parts (like players). You can read more about that here.

You could create a script for each player that creates local parts at the position of each dummy coin in the level, and whenever the dummy coin is touched, the local coin is destroyed. That way, you wouldn't need booltags, since you could simply check for the presence of the local coin to see if it's been collected.

Ad

Answer this question