Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

What is wrong With This chat Bubble script?

Asked by
Mauvn 100
11 years ago

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!

001function clear(char)
002local c = char:GetChildren()
003    for i = 1,#c do
004    if c[i].className == "Model" then
005    c[i]:Remove()
006    end
007    end
008end
009 
010 
011function onChatted(msg, recipient, speaker)
012    if speaker.Character ~= nil then
013        clear(speaker.Character)
014        if msg == "RANK" then
015            local person = game.Workspace.MainScript.Members:findFirstChild(speaker.Name)
View all 106 lines...
0
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 Destrings 406 — 11y
0
Sorry for that some people need the hole script to solve it :/ Mauvn 100 — 11y

1 answer

Log in to vote
0
Answered by
TheMyrco 375 Moderation Voter
11 years ago

I don't know what BubbleSpeech exactly is, but try this:

01function clear(char)
02    for _,v in pairs(char:GetChildren()) do
03        if v:IsA("Model") then
04            v:Destroy()
05        end
06    end
07end
08 
09game.Players.PlayerAdded:connect(function(p)
10    p.Chatted:connect(function(msg)
11        if p.Character then
12            clear(p.Character)
13            if msg == "RANK" then
14                local player = workspace.MainScript.Members:FindFirstChild(p.Name)
15                local bubble = script.BubbleSpeech:Clone()
View all 52 lines...
Ad

Answer this question