So I’m making a custom chat and I want the players name to be a different colour. I am using two text labels for this, one with the player’s name and one with the message, and I am calculating the offset required for the players name label. Here is my code
I tried this and it sets the X scale size to nan. The absoluteSize.X of playerName is 0 so that’s probably why. The Explorer looks like this
GlobalMessage - ScrollingFrame
----Message - Frame
--------PlayerName - TextLabel
--------Message - TextLabel
I’ve tried messing around with it but nothing seems to work.
As you already have the offset of PlayerName (through your method of calculation) you can use the offset you found with the AbsoluteSize of your message frame
local MessageOffsetScale = Message.AbsoluteSize.X
local Scale = (#Message.PlayerName.Text * 8) / MessageOffsetScale
Be sure that the frame are visible on the screen before using AbsoluteSize As AbsoluteSize is set when it’s inside the playerGUI