Table vs Instances for combat relateed values

Hello. For values determining combat actions, like lets say bool values like canDash, canAttack etc, does it make more sense to use tables or instances? I can either set up a server sided module that creates a table for each player and replicate the changes to a client-sided read only table, or simply use instances located inside each player. Which one do you guys think is better for performance?

1 Like

tables are better, though you can use either the difference is minor

Why not just straight up go for closures?
Why table if you can have a straight up value? :money_mouth_face:

dont you have to store closures in a table?

no
Closures is a function that captures upvalues.

Do you think it is minor enough even for a fast paced combat game? Setting the system up is too bothersome so I rather use instances if it won’t change much

I’m gonna dissagree with previous people.

Tables would be better if you weren’t replicating them. Attributes and Instances are better for replication unless you’re really experienced with network code.

Why?

  1. Instances are compatible with streaming enabled.
  2. Instances are already optimized by Roblox, who have access to the stuff we don’t.

Trust me when I say, simplicity is key. Never trade simplicity for performance, when you don’t have a performance issue.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.