local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"
or
local leaderstats = Instance.new("IntValue",player)
leaderstats.Name = "leaderstats"
I would like to know the difference between these two. I recall watching a video in which the publisher told me to make it an IntValue, and not ask questions. It felt strange to me because theres no use of its value, then later on I checked other sources on the internet and they all instanced a folder with that name...
Later on, I even tried
local leaderstats = Instance.new("Part",player)
leaderstats.Name = "leaderstats"
and that works aswell :D
This may be a trivial question, or a question about efficiency, but I'd like to get an answer nonetheless.
Thanks for your time.
Edit : Thanks for your replies, I also checked
local leaderstats = Instance
But it was a readonly value... so... I glanced for a while at the "Advanced Objects" toolbar and concluded for all of us, that instancing it as a "Folder" is, for now, optimal.
However I'd love to be able to instance simpler objects than even a folder... A folder has 3 Attributes ( one of which being ClassName and the other two already necessary stuff (Name and Parent) ) The only thing I could get rid of would be the "Archivable" behaviour, which can be useful time to time, and is already present on all roblox instances...
So final conclusion : USE A FOLDER.

6 comments
HEY, don't set the parent in the Instance.new() function. It can create lag!
See this: https://devforum.roblox.com/t/psa-dont-use-instance-new-with-parent-argument/30296
I recommend hiding all the data inside the script itself in server script service that way no hacker can see the data for other players for certain games that would be a benefit!
I actually never thought of that, greatneil80. Or you could hide everything in server storage, if you want to be clean.
Pretty cool trick I thought of a while ago c:
@BashGuy10 thanks, I checked it and approved that you are right. I won't use the second argument of instancing for that purpose anymore. And @greatneil80 I already like to do pretty much everything from server side whenever I can. However I cant see how your recommendation was referring to the topic. Thanks anyways :)