code
this is a chat script
non local script
help me pls
chat text at line 6
function click()
local b = script.Parent.Parent.Parent.Parent.BattleName.Value
for i,v in pairs (workspace.Battle[b].Player:GetChildren()) do
local p = script.Parent.Parent.Parent.Parent.Parent.Parent
local t = game.Players[v.Name].PlayerGui.Battle.Chat.TextBox.Chat
local chat = script.Parent.Parent
if t["1"].Text == "" then
t["1"].Text = p.Name..":"..chat.Text
chat.Text = ""
elseif t["1"].Text ~= "" then
if t["2"].Text == "" then
t["2"].Text = t["1"].Text
t["1"].Text = p.Name..":"..chat.Text
chat.Text = ""
elseif t["2"].Text ~= "" then
if t["3"].Text == "" then
t["3"].Text = t["2"].Text
t["2"].Text = t["1"].Text
t["1"].Text = p.Name..":"..chat.Text
chat.Text = ""
elseif t["3"].Text ~= "" then
if t["4"].Text == "" then
t["4"].Text = t["3"].Text
t["3"].Text = t["2"].Text
t["2"].Text = t["1"].Text
t["1"].Text = p.Name..":"..chat.Text
chat.Text = ""
elseif t["4"].Text ~= "" then
if t["5"].Text == "" then
t["5"].Text = t["4"].Text
t["4"].Text = t["3"].Text
t["3"].Text = t["2"].Text
t["2"].Text = t["1"].Text
t["1"].Text = p.Name..":"..chat.Text
chat.Text = ""
elseif t["5"].Text ~= "" then
if t["6"].Text == "" then
t["6"].Text = t["5"].Text
t["5"].Text = t["4"].Text
t["4"].Text = t["3"].Text
t["3"].Text = t["2"].Text
t["2"].Text = t["1"].Text
t["1"].Text = p.Name..":"..chat.Text
chat.Text = ""
elseif t["6"].Text ~= "" then
if t["7"].Text == "" then
t["7"].Text = t["6"].Text
t["6"].Text = t["5"].Text
t["5"].Text = t["4"].Text
t["4"].Text = t["3"].Text
t["3"].Text = t["2"].Text
t["2"].Text = t["1"].Text
t["1"].Text = p.Name..":"..chat.Text
chat.Text = ""
elseif t["7"].Text ~= "" then
t["7"].Text = t["6"].Text
t["6"].Text = t["5"].Text
t["5"].Text = t["4"].Text
t["4"].Text = t["3"].Text
t["3"].Text = t["2"].Text
t["2"].Text = t["1"].Text
t["1"].Text = p.Name..":"..chat.Text
chat.Text = ""
end
end
end
end
end
end
end
end
end
script.Parent.MouseButton1Click:connect(function() click() end)
