jaipack17
(jaipack17)
August 31, 2021, 12:38pm
11
leogodgg:
plr.Stats
Just do folder instead, you should also use currency.Parent = folder instead of using the Second argument of Instance.new(). I can see you aren’t using pcalls for your datastore. So add those as well.
Links:
I’ve discovered a pretty bad performance issue in one of top games that has to do with Instance.new and wanted to write about this, since this is not obvious unless you know the system inside out.
Tthere are several ways to create a ROBLOX object in Lua:
local obj = Instance.new(‘type’); fill obj fields
local obj = Instance.new(‘type’, parent); fill obj fields
local obj = util.Create(‘type’, { field1 = value1, … })
If you care at all about performance, please only use the first option - I wi…
Intoduction
Protected calls, formally known as pcalls, can run functions without erroring and provide if your code was successfully ran but what’s the best way to use them and when should I?
In this tutorial I will be covering the entirety of pcalls and where you’ll need them, so lets begin!
Pcall basics
First and foremost, we should learn what pcall’s syntax really looks like:
pcall(f : function, ...args : any)
Basically, you pass your desired function in as argument 1 and any arguments you…