I have a Chat Bubble Script that if a Player Talk The chat bubble over his head will show his Group rank, But it's not working. Please Help!
function clear(char)
local c = char:GetChildren()
for i = 1,#c do
if c[i].className == "Model" then
c[i]:Remove()
end
end
end
function onChatted(msg, recipient, speaker)
if speaker.Character ~= nil then
clear(speaker.Character)
if msg == "RANK" then
local person = game.Workspace.MainScript.Members:findFirstChild(speaker.Name)
if person ~= nil then
local bubble = script.BubbleSpeech:clone()
bubble.PrevL.Value = 30
bubble.Name = person.Name.." is rank "..tostring(person.Value)
bubble.Head.BrickColor = BrickColor.new("Toothpaste")
bubble.Parent = speaker.Character
else
local bubble = script.BubbleSpeech:clone()
bubble.PrevL.Value = 30
bubble.Name = speaker.Name.." is not a member of SS"
bubble.Head.BrickColor = BrickColor.new("Toothpaste")
bubble.Parent = speaker.Character
end
else
if string.len(msg) < 101 then
local bubble = script.BubbleSpeech:clone()
bubble.Name = msg
bubble.PrevL.Value = string.len(bubble.Name)
bubble.Parent = speaker.Character
bubble.Head.Anchored = false
bubble.Head.CanCollide = false
end
if string.len(msg) > 100 and string.len(msg) < 201 then
local bubble = script.BubbleSpeech:clone()
bubble.Name = string.sub(msg,1,100)
bubble.PrevL.Value = 100
bubble.Parent = speaker.Character
bubble.Head.Anchored = false
bubble.Head.CanCollide = false
--bubble.Row.Value = 1.5
local bubble2 = script.BubbleSpeech:clone()
bubble2.Name = string.sub(msg,100,200)
bubble2.PrevL.Value = 100 + string.len(bubble2.Name)
bubble2.Parent = speaker.Character
bubble2.Head.Anchored = false
bubble2.Head.CanCollide = false
end
if string.len(msg) > 200 and string.len(msg) < 301 then
local bubble = script.BubbleSpeech:clone()
bubble.Name = string.sub(msg,1,100)
bubble.PrevL.Value = 100
bubble.Parent = speaker.Character
bubble.Head.Anchored = false
bubble.Head.CanCollide = false
--bubble.Row.Value = 3
wait(0.5)
local bubble2 = script.BubbleSpeech:clone()
bubble2.Name = string.sub(msg,100,200)
bubble2.PrevL.Value = 200
bubble2.Parent = speaker.Character
bubble2.Head.Anchored = false
bubble2.Head.CanCollide = false
--bubble2.Row.Value = 1.5
wait(0.5)
local bubble3 = script.BubbleSpeech:clone()
bubble3.Name = string.sub(msg,200,300)
bubble3.PrevL.Value = 200 + string.len(bubble3.Name)
bubble3.Parent = speaker.Character
bubble3.Head.Anchored = false
bubble3.Head.CanCollide = false
end
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)

2 comments
I'm afraid this script will took too much time to look trough so you are most likely not going to get an answer unless you narrow the problem
Sorry for that some people need the hole script to solve it :/