Lets imagine i have a playeradded event on the server and on the client. Does the event fires first on the server, waits to finish the function on the server and then fires on the client, or is it at the same time ?
What is faster between :
Tab1 = {
a = 1,
b = 2,
c = 3,
o = 3,
p = 3,
u = 3,
y = 3,
g = 3,
h = 3
} --lets imagine this is a rly big table and not subdivided
and
Tab2 = {
abc = {
a = 1,
b = 2,
c = 3
},
opu = {
o = 3,
p = 3,
u = 3
},
etc = {
y = 3,
g = 3,
h = 3
}
} --lets imagine this is a rly big table as well but subdivided
I am not sure how to answer your second question, but to the first question, you can test it.
Add a local script and print the player name when added, and do the same on the server, see what’s being printed first. The source of the print is your answer.
Note: make sure there is more than 1 player.
I actually don’t think there’s a difference in the second question, but not sure.
It doesn’t even fire on the Client (for the same client I meant) unless you somehow manage to defer its execution, since to do anything client-side you’d need a LocalScript - and LocalScripts are replicated to clients after the PlayerAdded event fires for said client, meaning the listener would be added too late.
Yes that’s right and I realized I’d need to clarify further right after I read my post, couldn’t edit anything because my internet left right after I posted that.
Though it was fairly obvious I was referring to the PlayerAdded event only for the client who joins, you can consider this as clarification.
For the first question accessing just one index should be faster than accessing through nested tables.