@Link150 you have a point. but if am answer was the helping answer, it's nature for them to accept the answer. plus i see answers with no explanation of what they fixed, some just copy and paste the same exact code the asker provided! it's ridiculous.
This is just about an exact copy of the dev-forum page, with a few minor syntaxial changes. Please don't repost content here, even if credit is given, without at least adding/revising more to it. Especially since this is a fairly dated post that most developers have seen.
@LegitimatlyMe That ruins the whole point of sets. If the value is not present then your set:Contains(x) method will perform an unsuccessful linear search for it anyway.
There's a better solution: hashes. Compute a hash of your set elements and use that as the key. Two vectors that compare equal should return the same hash.
Any value that is to be able to be added to a set should define a hash() method. Primitive types can be hashed by some global hash() function. This function should just fallback to the hash() method of its argument for complex objects.
@incapaz I don't know the exact reason, but if I had to take a couple of guesses:
It might be because Scripts and LocalScripts can access the Lighting service.
It might be because of how they stumbled upon it. For example, they might've seen that Person299 uses the Lighting service for storage, and from there got the idea that it's a good place to put their assets, such as script/models, without them running in the game.
This's just my opinion, however; they're not the 100%/exact reason why people'll using Lighting for storage.