scriptingtales

Untitled

Jun 22nd, 2022 (edited)
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. local Contain = script or Instance.new("Model")
  2. Contain.Name = "ChatHint"
  3. Contain.Parent = game.Workspace
  4. function Say(text,part)
  5. if not Contain or not part.Parent then return end
  6. local BBG = Instance.new("BillboardGui",Contain)
  7. BBG.Adornee = part
  8. BBG.Size = UDim2.new(5,0,5,0)
  9. BBG.LightInfluence = 0.1
  10. local TL = Instance.new("TextLabel",BBG)
  11. TL.AnchorPoint = Vector2.new(0.5,0.5)
  12. TL.Position = UDim2.new(0.5,0,-0.5,0)
  13. TL.Size = UDim2.new(2,0,2,0)
  14. TL.BackgroundTransparency = 1
  15. TL.TextStrokeTransparency = 0
  16. TL.TextScaled = true
  17. TL.Font = Enum.Font.Bodoni
  18. TL.TextColor3 = Color3.new(1,1,1)
  19. TL.TextStrokeColor3 = Color3.new(0,0,0)
  20. local BodyColor = part:FindFirstChildWhichIsA("BodyColors") or part.Parent:FindFirstChildWhichIsA("BodyColors")
  21. if BodyColor then
  22. TL.TextColor3 = BodyColor.TorsoColor3
  23. TL.TextStrokeColor3 = BodyColor.LeftLegColor3
  24. end
  25. TL.Text = text
  26. for i = 1,75 do
  27. if BBG then
  28. wait(0.1)
  29. BBG.StudsOffset = Vector3.new(0,i / 3.5,0)
  30. end
  31. end
  32. if BBG then
  33. BBG:Destroy()
  34. end
  35. end
  36.  
  37. function ChatPart(part,text,color)
  38. if part and part:FindFirstAncestorWhichIsA("Workspace") then
  39. if part.Parent.ClassName == "Model" then
  40. Say(tostring(part.Parent).." ( "..string.sub(tostring(part.Parent),1,1).." ) : "..text,part)
  41. elseif game.Players:GetPlayerFromCharacter(part) then
  42. Say(tostring(game.Players:GetPlayerFromCharacter(part)).." [ "..string.sub(tostring(game.Players:GetPlayerFromCharacter(part)),1,1).." ] : "..text,part)
  43. else
  44. Say(tostring(part).." { "..string.sub(tostring(part),1,1).." } : "..text,part)
  45. end
  46. end
  47. end
  48. game:GetService("Chat").Chatted:connect(ChatPart)
  49.  
  50. function PreparePlayer(player)
  51. local Player = player
  52. local function ChatPlayer(text,recipient)
  53. if recipient == nil then
  54. local newtext = game:GetService("Chat"):FilterStringForBroadcast(text,player)
  55. Say(tostring(player).." [ "..string.sub(tostring(player),1,1).." ] : "..newtext,player.Character)
  56. end
  57. end
  58. player.Chatted:connect(ChatPlayer)
  59. end
  60.  
  61. wait(2)
  62. local P = game.Players:GetPlayers()
  63. for i = 1,#P do
  64. PreparePlayer(P[i])
  65. end
  66.  
  67. function PlayerAdded(player)
  68. PreparePlayer(player)
  69. end
  70. game.Players.PlayerAdded:connect(PlayerAdded)
Add Comment
Please, Sign In to add comment