Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How should I organize a coin pickup system?

Currently, my plan is to have a server script that manages coin spawns and their values, and a local script for the player to check for collisions with coins and add that value to a player gui. However, I want to save player data, which would need to be handled by the server, so would it just be easier to have the server check for collisions and increment the value for each player? Or are both systems valid?

1 answer

Depends on if the coins should disappear for everyone when you pick them up.

If my character picks up a coin, and your player still sees it I would: Check for collisions on the client, On a collision tell the server that there was a collision with coin x, Server will verify the collision and increment that stat, Client should delete the coin if the server returned true (no errors)

If the coin should be removed for everyone: Server checks for collisions, On a collision remove the coin, Increment that characters stats

This discussion is preserved as it was. New answers, comments, and votes are closed.