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

What is wrong with this chat gui?

Asked by 10 years ago

t = Instance.new("Frame") t.Size = UDim2.new(0,0,0,20) t.Position = UDim2.new(0,10,0,0) t.BackgroundTransparency = 1

name_label = Instance.new("TextLabel") name_label.Name = "name_label" name_label.BackgroundColor3 = Color3.new(221/255, 221/255, 221/255) name_label.Size = UDim2.new(0,0,1,0) name_label.TextColor3 = Color3.new(0,0,0) name_label.BackgroundTransparency = 0 name_label.BorderSizePixel = 0 name_label.Parent = t msg_label = Instance.new("TextLabel") msg_label.FontSize = "Size10" msg_label.Name = "msg_label" msg_label.BackgroundColor3 = Color3.new(178/255, 178/255, 178/255) msg_label.TextColor3 = Color3.new(0,0,0) msg_label.BackgroundTransparency = 0 msg_label.Size = UDim2.new(0,0,1,0) msg_label.BorderSizePixel = 0 msg_label.Parent = t msg_label.Text = "[ Content Deleted ]" shine1 = Instance.new("ImageLabel") shine1.Name = "Bevel" shine1.Image = "http://www.roblox.com/asset/?id=36469741" shine1.Size = UDim2.new(1,0,1,0) shine1.Parent = msg_label shine1.ZIndex = msg_label.ZIndex+1 shine1.BackgroundTransparency = 1 shine1 = Instance.new("ImageLabel") shine1.BackgroundTransparency = 1 shine1.Name = "Bevel" shine1.Image = "http://www.roblox.com/asset/?id=36469741" shine1.Size = UDim2.new(1,0,1,0) shine1.Parent = name_label shine1.ZIndex = name_label.ZIndex+1 image = Instance.new("ImageLabel") image.BackgroundTransparency = 1 image.BorderSizePixel = 0 image.Parent = t image.Name = "Icon" image.Size = UDim2.new(0,20,0,20) image = Instance.new("ImageLabel") image.BackgroundTransparency = 1 image.BorderSizePixel = 0 image.Parent = t image.Name = "Icon2" image.Size = UDim2.new(0,20,0,20) credit = Instance.new("TextLabel") credit.Position = UDim2.new(0,15,0,5) credit.FontSize = "Size10" credit.TextColor3 = Color3.new(0,0,0) credit.Text = "" credit.Parent = script.Parent credit.Name = "Toast" credit.TextXAlignment = "Left"

lab = {}

checking = false function msgCheck(obj) if checking == true then print("Waiting") repeat wait() until not checking end checking = true local pmsg = obj local pspeaker = obj:findFirstChild("speaker") if pmsg and pspeaker then print(pmsg.Value.." "..pspeaker.Value.Name) if pmsg.Value ~= "" then if pspeaker.Value ~= nil then show(pmsg.Value, pspeaker.Value.Name, pspeaker.Value) obj:Remove() else show(pmsg.Value, "Game System", nil) obj:Remove() end end end checking = false end

function show(message, speaker, speak) if not credit or not credit.Parent then return end local new = t:Clone() new.Visible = false new.name_label.Text = speaker wait() new.Parent = script.Parent wait() local text_x_size = string.len(speaker)6+5 print(text_x_size) new.name_label.Size = UDim2.new(0, text_x_size+10, 1, 0) new.name_label.Position = UDim2.new(0,0,0,0) new.msg_label.Position = UDim2.new(0,text_x_size+10,0,0) new.msg_label.Text = message wait() local msg_x_size = string.len(new.msg_label.Text)7+5 new.msg_label.Size = UDim2.new(0,msg_x_size+10, 1, 0) new.Position = UDim2.new(0,5,0,125)

if speak then
    local bctype = tostring(speak.MembershipType):sub(21)
    if bctype == "None" then
        new.Icon.Image = "http://www.roblox.com/asset/?id=43869006"
    elseif bctype == "BuildersClub" then
        new.Icon.Image = "http://www.roblox.com/asset/?id=42268759"
    elseif bctype == "TurboBuildersClub" then
        new.Icon.Image = "http://www.roblox.com/asset/?id=43856172"
    elseif bctype == "OutrageousBuildersClub" then
        new.Icon.Image = "http://www.roblox.com/asset/?id=43856244"
    end 
else
    new.Icon.Image = "http://www.roblox.com/asset/?id=35903248"
end

if speak and speak.userId == game.CreatorId then
    new.Icon2.Image = "http://www.roblox.com/asset/?id=43870991"
end

new.Icon.Position = UDim2.new(0,msg_x_size+text_x_size+21,0,0)
new.Icon2.Position = new.Icon.Position + UDim2.new(0,20,0,0)

new.Name = "Chat"
new.Size = UDim2.new(0,1,0,20)
table.insert(lab, 1, new)
script.Click:Play()
move()

end

function move() for i = 1, 10 do for i2, v2 in pairs(lab) do if i2 == 1 and i == 1 then v2.msg_label.TextTransparency = 1 v2.msg_label.BackgroundTransparency = 1 v2.name_label.TextTransparency = 1 v2.name_label.BackgroundTransparency = 1 v2.Visible = true end if i2 == 1 then v2.Position = v2.Position - UDim2.new(0,0,0,2) if i < 6 then v2.msg_label.TextTransparency = v2.msg_label.TextTransparency - .1 v2.msg_label.BackgroundTransparency = v2.msg_label.BackgroundTransparency - .1

            v2.name_label.TextTransparency = v2.msg_label.TextTransparency - .1
            v2.name_label.BackgroundTransparency = v2.msg_label.BackgroundTransparency - .1
            end
        elseif i2 == 6 then
            v2.Position = v2.Position - UDim2.new(0,0,0,2)
            v2.msg_label.TextTransparency = v2.msg_label.TextTransparency + .1
            v2.msg_label.BackgroundTransparency = v2.msg_label.BackgroundTransparency + .1
            v2.name_label.TextTransparency = v2.msg_label.TextTransparency + .1
            v2.name_label.BackgroundTransparency = v2.msg_label.BackgroundTransparency + .1
            if i == 10 then
            v2:Remove()
            table.remove(lab, 6)
            end
        else
            v2.Position = v2.Position - UDim2.new(0,0,0,2)
        end
    end
wait()
end 

end

script.Parent.Message.ChildAdded:connect(msgCheck)

show("Welcome to My Game!", "Game")

letters = {"e","d","c","b","a"}

for i, v in pairs(letters) do letter = Workspace.Chat2[v] local dub = string.find(letter.Value, "||") if dub then show(letter.Value:sub(dub+2), letter.Value:sub(1, dub-1), game.Players[letter.Value:sub(1, dub-1)]) end end

Answer this question