So I want to make some abilities (ex: fireball, etc…) with tools but i saw people putting the local script, remote event and the script inside the tool and i don’t understand why.
And there is another problem, the player can just unequip the tool in the middle of the attack which i don’t want.
Local scripts run on the player’s client, which means they can handle things like user input and animations. When the player clicks a button or presses a key to activate an ability, the local script can detect this input and initiate the process.
Remote events are used to send information from the client (local script) to the server (script inside the tool) or vice versa.
The script inside the tool handles the actual ability logic on the server. It receives the request from the local script through the remote event, validates it (to prevent cheating), and then carries out the ability.
You can lock the tool in the player’s backpack while the attack is in progress. To do this, you can add a script to the tool that locks and unlocks it based on the current state of the ability. For example, when the player initiates the attack, you lock the tool, and when the attack is complete, you unlock it.
But why do they put the remote event and the script inside the tool can’t i put the script just in serverscriptservice and the remote event in replicated storage ?
Local Scripts do not run in ServerScriptService
I mean the normal script not the local script
I don’t really know but here’s a theory The script could have like a Value That says how much Damage the player does and stats about the player’s attacks
Make sure that the Player is the Player that the script is parented to (so others can’t hack and send Events to Other Players’s RemoteEvents)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.