Is My Script performance OK?

Hello everyone, I took a look at my game’s script performance (from client, so it’s local scripts).


ChangeWinterScript, 4.1% activity - runs GetPartInPart() every second to see if the player is in a certain area. However, there are many other objects in it as well, such as trees, rocks, etc.

Crafting Script, 2.7% - It needs to be very fast, and it checks the player’s resources to see if they have enough for any of the 20+ craftables.

BonFireScript, 10 count, 2.1% - I had 10 bonfires in my backpack, and they are all doing repeat wait() until script.Parent.Equipped, and when they are equipped, they will be consistently directly infront of the player, so they can place it.

ManageArray 0.5% - A crafting dictionary, which features all 20+ items rotating with a viewport frame.

Minimap controller, 0.25% - A minimap.

Thanks for the feedback :smiley:

Just realized I could use getpartsinpart() in the HumanoidRootPart, instead of the winter hitbox. Now the script is down to 0.2% :DDD

You shouldn’t do this.

Use an event based method instead of polling.

script.Parent.Equipped:Wait()

And another thing, make sure to always use task.wait(n) over wait(n).

2 Likes