What are some deprecated methods/bad practices to avoid?

Hello!

I’ve recently been developing (scripting) a lot more than I have in the past.
I just learned that wait() is a deprecated function from a DevForum post. I had never even heard of this before and I had no clue.
I also recently (a few months ago) to use RunService instead of while loops.

This prompted a thought. What are some commonly used practices that can actually negatively impact performance or efficiency, or lead to errors?

Thank you!

1 Like

Well, when you load animations on rigs, to use:

rig.Humanoid:LoadAnimation(animation)

Is now deprecated to:

rig.Humanoid.Animator:LoadAnimation(animation)
1 Like

use game:GetService(ServiceName) instead of doing game.ServiceName

3 Likes

This:

local part = Instance.new("Part", parent)

is slower than this:

local part = Instance.new("Part")
part.Parent = parent
1 Like

And use workspace instead of game:GetService("Workspace")

1 Like

Approximately 3.8 times slower.

image

wait(10) -- for the game to load for accurate results

local time1 = os.clock()

local newpart = Instance.new("Part", workspace)

local time2 = os.clock()

local othernew = Instance.new("Part")
othernew.Parent = workspace

local time3 = os.clock()

print(`Method 1 time: {time2 - time1}`)
print(`Method 2 time: {time3 - time2}`)
1 Like