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

Chat Bubble Script help? **REPOSTED AND UNSOLVED**

Asked by
Mauvn 100
11 years ago

Hello, i'm doing a custom chat bubble script and when a player talks it will show his group rank, but it doesn't show it. Any kind of help is appreciated! :)

Script:

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
Is there an out put, also explain more what your having difficulty with. HexC3D 830 — 11y
0
What Hex said and also if there is no errors/output, put in prints in each stage of the script, it will tell you what it gets to. lomo0987 250 — 11y
0
Ok thanks for the tip i'll go try it out. Mauvn 100 — 11y

1 answer

Log in to vote
-1
Answered by
mhd100 5
11 years ago

Try this script but edit the group numbers;

local spawnbin = {}

function findSpawns(root) local childers = root:getChildren() for i = 1,#childers do if childers[i].className == "SpawnLocation" then table.insert(spawnbin,childers[i]) elseif childers[i].className == "Model" then findSpawns(childers[i]) end end end

findSpawns(game.Workspace)

function findTags(player) local tags = "" if player:IsInGroup(217181) then rank = player:GetRoleInGroup(217181) tags = rank end return tags end

function onPlayerRespawned(newPlayer) local mycurrentspawns = {} for i = 1,#spawnbin do if spawnbin[i].TeamColor == newPlayer.TeamColor then table.insert(mycurrentspawns,spawnbin[i]) end end if #mycurrentspawns < 1 then return end movetospawn(newPlayer,mycurrentspawns[math.random(1,#mycurrentspawns)]) end

function movetospawn(player,spawn) if player ~= nil and spawn ~= nil then local torso = player.Character:findFirstChild("Torso") if torso ~= nil then torso.CFrame = spawn.CFrame + Vector3.new(0,2,0) end end end

function onPlayerEntered(newPlayer) wait(1) player = newPlayer onPlayerRespawned(newPlayer) newPlayer.Changed:connect(function (property) if (property == "Character") then onPlayerRespawned(newPlayer) end end) end

game.Players.PlayerAdded:connect(onPlayerEntered)

p = game.Players:GetPlayers() for i = 1,#p do onPlayerEntered(p[i]) end

while true do players = game.Players:GetPlayers() for i = 1,#players do player = players[i] char = player.Character if char ~= nil then if char:findFirstChild("Head") ~= nil then local test = char.Head:findFirstChild("RankGui") if test == nil then local bg = script.RankGui:clone() local label = bg.Label local rank = "" if game:GetService("Teams") ~= nil then local teams = game.Teams:getChildren() local vTeam = nil for t = 1,#teams do if teams[t].TeamColor == player.TeamColor then vTeam = teams[t] end end if vTeam == nil then rank = "Guest" else rank = vTeam.Name end else rank = "Guest" end if findTags(player) ~= "" then rank = findTags(player) end label.TextStrokeColor3 = player.TeamColor.Color label.Text = rank bg.Parent = player.Character:findFirstChild("Head") end end end end wait(0.1) end

0
Could you please do Code block? Mauvn 100 — 11y
Ad

Answer this question