String.Sub issue

If you’re having an issue like this, then I suspect that you’re either using the parent argument of Instance.new or parenting before setting the value’s name. In this way, I assume the split is also being done immediately as an object of class IntValue gets added to the folder.

Never do that.

If you change the name before parenting, you won’t encounter such issues like needing to wait or anything of that sort. When an instance isn’t attached (parented) to the DataModel (game tree/hierarchy), you’re just modifying pieces of data. The moment it’s parented, it’ll already have its properties set, so you can immediately perform a split on the name.

2 Likes