Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Contain = script or Instance.new("Model")
- Contain.Name = "ChatHint"
- Contain.Parent = game.Workspace
- function Say(text,part)
- if not Contain or not part.Parent then return end
- local BBG = Instance.new("BillboardGui",Contain)
- BBG.Adornee = part
- BBG.Size = UDim2.new(5,0,5,0)
- BBG.LightInfluence = 0.1
- local TL = Instance.new("TextLabel",BBG)
- TL.AnchorPoint = Vector2.new(0.5,0.5)
- TL.Position = UDim2.new(0.5,0,-0.5,0)
- TL.Size = UDim2.new(2,0,2,0)
- TL.BackgroundTransparency = 1
- TL.TextStrokeTransparency = 0
- TL.TextScaled = true
- TL.Font = Enum.Font.Bodoni
- TL.TextColor3 = Color3.new(1,1,1)
- TL.TextStrokeColor3 = Color3.new(0,0,0)
- local BodyColor = part:FindFirstChildWhichIsA("BodyColors") or part.Parent:FindFirstChildWhichIsA("BodyColors")
- if BodyColor then
- TL.TextColor3 = BodyColor.TorsoColor3
- TL.TextStrokeColor3 = BodyColor.LeftLegColor3
- end
- TL.Text = text
- for i = 1,75 do
- if BBG then
- wait(0.1)
- BBG.StudsOffset = Vector3.new(0,i / 3.5,0)
- end
- end
- if BBG then
- BBG:Destroy()
- end
- end
- function ChatPart(part,text,color)
- if part and part:FindFirstAncestorWhichIsA("Workspace") then
- if part.Parent.ClassName == "Model" then
- Say(tostring(part.Parent).." ( "..string.sub(tostring(part.Parent),1,1).." ) : "..text,part)
- elseif game.Players:GetPlayerFromCharacter(part) then
- Say(tostring(game.Players:GetPlayerFromCharacter(part)).." [ "..string.sub(tostring(game.Players:GetPlayerFromCharacter(part)),1,1).." ] : "..text,part)
- else
- Say(tostring(part).." { "..string.sub(tostring(part),1,1).." } : "..text,part)
- end
- end
- end
- game:GetService("Chat").Chatted:connect(ChatPart)
- function PreparePlayer(player)
- local Player = player
- local function ChatPlayer(text,recipient)
- if recipient == nil then
- local newtext = game:GetService("Chat"):FilterStringForBroadcast(text,player)
- Say(tostring(player).." [ "..string.sub(tostring(player),1,1).." ] : "..newtext,player.Character)
- end
- end
- player.Chatted:connect(ChatPlayer)
- end
- wait(2)
- local P = game.Players:GetPlayers()
- for i = 1,#P do
- PreparePlayer(P[i])
- end
- function PlayerAdded(player)
- PreparePlayer(player)
- end
- game.Players.PlayerAdded:connect(PlayerAdded)
Add Comment
Please, Sign In to add comment