Head shrinking with nametag script

The issue:
When I apply the nametag script, the player’s head scaling appears to shrink. This only seems to be with R15.
image
Works correctly when BA’s :name command is used?
https://gyazo.com/c1d4ec4bff05f7426c49f8cb8618b6fa

What do I want to achieve?
I simply want to make it so the head scaling isn’t affected.

What solutions have I tried so far?
I’ve played around with the avatar scaling in the game settings, and the script I’m pretty sure has no part in it’s affect. I assume it’s a game setting issue I haven’t located…

Script
local commands = {}

function Create(ClassName)
 return function(Properties)
  local Obj = Instance.new(ClassName)
  for i,v in pairs(Properties) do
   if type(i) == 'number' then
    v.Parent = Obj
   else
    Obj[i] = v
   end
  end
  return Obj
 end
end
function HandleCharacter(Player, Character)
 local Custom = Character:WaitForChild('Head'):clone()
 Custom.Name = 'TastiesOverhead'
 Custom.Parent = Character
 Custom.face:Destroy()
 Character.Head.Transparency = 1
 Create'Weld'{
  Name = 'CustomWeld';
  Parent = Custom;
  Part0 = Character.Head;
  Part1 = Custom;
 }
 Create'BillboardGui'{
  Name = 'Nametag';
  Parent = Custom;
  Size = UDim2.new(5, 0, 0.5, 0);
  StudsOffset = Vector3.new(0, 2, 0);
  Create'TextLabel'{
   Name = 'NameLabel';
   BackgroundTransparency = 1;
   Size = UDim2.new(1, 0, 1, 0);
   Position = UDim2.new(0, 0, -0.8, 0);
   Font = 'ArialBold'; -- Font of the username
   Text = Character.Name;
   TextColor3 = Color3.new(1,1,1); -- Color of the username
   TextScaled = true;
   TextStrokeTransparency = 1;
  };
  Create'TextLabel'{
   Name = 'RankLabel';
   BackgroundTransparency = 1;
   Size = UDim2.new(1, 0, 0.92, 0);
   Position = UDim2.new(0, 0, 0.2, 0);
   TextTransparency = .1;
   Font = 'SourceSansItalic'; -- This is the font of the rank 
   FontSize = Enum.FontSize.Size14;
   Text = Player:GetRoleInGroup(5679480);
   TextColor3 = Color3.new(1,1,1); -- Color of the rank
   TextScaled = true;
   TextStrokeTransparency = 1;
  };
 }

 Custom.BrickColor = Character.Head.BrickColor
 Character.Head.Changed:connect(function()
  Character.Head.Transparency = 1
  Custom.BrickColor = Character.Head.BrickColor
 end)
 Character.Head.Mesh.Changed:connect(function()
  Custom:WaitForChild('Mesh').MeshId = Character.Head:WaitForChild('Mesh').MeshId
 end)
end

local rainbow = function(callback)
local frequency = 0.1
local i = 0 
while true do wait()
local red = math.sin(frequency*i + 0)*127+128 
local green = math.sin(frequency*i + 2*math.pi/3)*127+128 
local blue = math.sin(frequency*i + 4*math.pi/3)*127+128 
callback(Color3.new(red/255,green/255,blue/255)) i = i+1 
end end 
function HandlePlayer(Player)
 if Player.Character then
  HandleCharacter(Player, Player.Character)
 end
 Player.CharacterAdded:connect(function(Character) HandleCharacter(Player, Character) end)
 if Player.UserId == 0 or Player.UserId == 0 or Player.UserId == 0 or Player.UserId == 0 then
  Player.CharacterAdded:connect(function(char) local label = char:WaitForChild("TastiesOverhead") 
   coroutine.resume(coroutine.create(rainbow),function(color)label.Nametag.RankLabel.TextColor3 = Color3.new(color.r,color.g,color.b)end) 
  end)
 end
end
game.Players.PlayerAdded:connect(function(b)
 HandlePlayer(b)
end)
for i,v in pairs(game.Players:GetPlayers()) do
  HandlePlayer(v) 
end 
4 Likes

I’m guessing there’s code in your nametag script that’s creating this result?

If you could post the code I’ll check it out

2 Likes

Send the code, please.

Tags: Heart button ins’t working.

1 Like

Added the script into the post.

Try changing all the positions to the player Model.

Still not working.

The script works perfectly fine in other games, so I’m 99% sure it’s a game setting issue. Any idea what setting?

Can you send the properties of the BillboardGui?

Note: I have not fully reviewed your code.

I do have a theory. You say this only affects R15/Rthro. I think maybe your script is destroying or altering the connections between the scaling values in the character. If you look in the Humanoid, there should be multiple numeric values, such as “HeadScale”. Check to make sure when your code runs on R15, you aren’t breaking any connections between the Head and the character scaling feature. Such as, an Joint.

1 Like

I found your problem (I think)
you are using the wrong body part. all of the regular body parts (Head, Torso, Arms, Legs) are all animated. so when they move the GUI has to adapt to the new position making it look like its shrinking.

  • change the cloned head into a cloned HumanoidRootPart (the humanoidRootPart is not an animated part. if it was it would have weird camera effects)

  • make the welding so the cloned HumanoidRootPart is connected to the original HumanoidRootPart (if you clone the HumanoidRootPart clone to the head it makes the player really short)

  • change the gui’s stud offset to 4 on the y not 3 (you can do 3.5)

  • if you want to make it have a better effect make it so the the cloned Humanoid Root Part has a body position and make a while true do. In the while true do loop make the body force have the x and z to the heads position (don’t put y)

I hoped this helped!

3 Likes