This isn't a question about a particular script but about how the scripts themselves run.
Example: I have an attack in game that is triggered through a key. I have it put where everyone can access it. Multiple players are using said script to fire off the attack.
Would a new "instance" of the script be run every single time the script is called upon. Or is there a chance for issues to ever arise where say, Player1 and Player2 are aiming in two separate places, both call the script for the attack, but Player2's attack instead aims where Player1 was aiming because the script had Player1's mouse position stored in it at that very moment.
If it wasn't obvious, I'm very new to scripting and this both had me curious and feels like a detail I should figure out now before I run into issues later. Though I haven't had much luck on looking this up myself.
You use RemoteEvents. Using RemoteEvents will allow the player to make specific requests to the server. At the same time, this will allow the server to execute multiple requests from different players. It's like they're in completely different working environments.
Let's have this example:
Event.OnServerEvent:Connect(function(p) print(p.Name, 'has invoked the RemoteEvent") end);
And two players call it on the exact same picosecond (extremely unlikely--higher chance of getting struck by lightning).
It would print both at (basically) the same time.