Advertisement
PLasMAtiC

Roblox Name Tag Script

Apr 11th, 2019
10,559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. local Adjustment = Vector2.new(5,1)
  2.  
  3. local function CreateNameTag(Head)
  4. local Adornee = Head:Clone()
  5. Adornee:ClearAllChildren()
  6. Adornee.Transparency = 1
  7.  
  8. local BillboardGui = Instance.new("BillboardGui",Adornee)
  9. BillboardGui.Size = UDim2.new(1,0,1,0)
  10. BillboardGui.StudsOffset = Vector3.new(0,2,0)
  11.  
  12. local Frame = Instance.new("Frame",BillboardGui)
  13. Frame.Size = UDim2.new(1,0,1,0)
  14. Frame.BackgroundTransparency = 1
  15.  
  16. local TextLabel = Instance.new("TextLabel",Frame)
  17. TextLabel.BackgroundTransparency = 1
  18. TextLabel.Size = UDim2.new(Adjustment.X,0,Adjustment.Y,0)
  19. TextLabel.Position = UDim2.new((1 - Adjustment.X)/2,0,(1 - Adjustment.Y)/2)
  20. TextLabel.TextColor3 = Color3.new(1,1,1)
  21. TextLabel.TextScaled = true
  22.  
  23. return Adornee, TextLabel
  24. end
  25.  
  26. game.Players.PlayerAdded:connect(function(Player)
  27. Player.CharacterAdded:connect(function(Character)
  28. if Player.Name ~= "Player1" and Player.Name ~= "YOURUSERNAMEHERE" then
  29. local Head = Character:WaitForChild("Head")
  30. local Adornee, TextLabel = CreateNameTag(Head)
  31. TextLabel.Text = Player.Name
  32. Adornee.Parent = Instance.new("Model",Character)
  33.  
  34. local Joint = Instance.new("Weld")
  35. Joint.Part0 = Head
  36. Joint.Part1 = Adornee
  37. Joint.Parent = game.JointsService
  38. wait()
  39. game.Workspace:WaitForChild(Player.Name):WaitForChild("Humanoid").DisplayDistanceType = "None"
  40. else
  41. local Head = Character:WaitForChild("Head")
  42. local Adornee, TextLabel = CreateNameTag(Head)
  43. TextLabel.Text = Player.Name .. "[Developer]"
  44. TextLabel.TextColor3 = Color3.fromRGB(0,255,0)
  45. Adornee.Parent = Instance.new("Model",Character)
  46.  
  47. local Joint = Instance.new("Weld")
  48. Joint.Part0 = Head
  49. Joint.Part1 = Adornee
  50. Joint.Parent = game.JointsService
  51. wait()
  52. game.Workspace:WaitForChild(Player.Name):WaitForChild("Humanoid").DisplayDistanceType = "None"
  53. end
  54. end)
  55. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement