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.
It really doesn't matter, it can be anything, a part, a fire object, a model, a script, you name it. Just name it "leaderstats". But I'd recommend using folders just to be consistent, as the PlayerGui, PlayerScripts, Backpack, StarterGear, have folder icons. I personally use Configuration objects since they're kinda folders specifically for ValueBase instances.
When you try inserting something into a configuration in the explorer, it only lets me insert ValueBase instances from the options. Also because it has a little icon under it, which blends in with the other player folders.
from how i see it use int value if you using 1 currency but use folder if you make multiple currencys like for example 1 is just by using cash but more then 1 would be cash,coins, and gold