I am making a magic based game. Different keys correspond with different skills, pretty basic stuff.
Steps:
Player presses a key that has a spell attached.
RemoteFunction is invoked verifying the player can use desired spell.
If the player can use the spell, the RemoteFunction returns true.
The client and server communicate and create the spell.
This system works, however there is definitely a bit expected lag between the server and client communication. Other games that I test out still have this but it is not as noticeable. How can I mask the slight client - server latency?
To get instant feedback, you’d need to do the spell stuff on the client.
Best solution to this, I think, is to localize all of the spells (since they’re mostly effects, right?), and just send barebones info to the server to verify.
If it wasn’t allowed, the server can simply refrain from sending any data to the other players, making the effect only happen for the exploiter.
Use RemoteEvents instead, create all effects locally then tell the server that the player has used a spell, confirm it on the server then tell all other clients that the player has used the spell so they could create their own effects locally.