I have buttons on the Client which cast a spell with a loss of x amounts of mana. However, I don’t want to rely on the client to check if the player has enough mana. I would use a RemoteEvent, but I would need to notify the player, so I can use a RemoteFunction. The argument passed will be the spell to cast. The remote would return a boolean.
Is this the best way to handle a mana system? If not, how can I improve security in this structure?
When using the spell, I would first check on the client if the player has enough mana, and if so, fire a RemoteEvent to the server to use the spell (on the server, check if the player has enough mana again, and then subtract the mana and fire a RemoteEvent to the client with the updated mana).
Won’t you have basic data (such as mana or currency) exposed to the client? Such as for a mana bar? Anyways, if you are using a RemoteFunction, there is no need to check on the client.