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

Why won't this ball make chat?

Asked by 8 years ago

This script is supposed to make a ball chat when you touch it, using the help of a BillboardGui:

debounce = false
ball = script.Parent
dbwait = 5
script.Parent.Touched:connect(function(hit)
    local chat = math.random(1,5)
    if debounce then return end
    --FIRST CHAT OUTCOME--


    if chat == 1 then
        local ChatBox = Instance.new("BillboardGui")
        ChatBox.Parent = ball
        ChatBox.AlwaysOnTop = true
        local Text = Instance.new("TextLabel",ChatBox)
        Text.Name = "Chat"
        Text.BackgroundTransparency = 1
        Text.BorderSizePixel = 0
        Text.Text = "u r touch me why?"
        Text.FontSize = "Size36"
        Text.TextColor3 = Color3.new(255,255,255)
        debounce = true
        wait(dbwait) -- Debounce end
        debounce = false
        ChatBox:Destroy()
    --SECOND CHAT OUTCOME--


    elseif chat == 2 then
        if hit.Parent:FindFirstChild("Humanoid")~=nil then
        local ChatBox = Instance.new("BillboardGui")
        ChatBox.Parent = ball
        ChatBox.AlwaysOnTop = true
        local Text = Instance.new("TextLabel",ChatBox)
        Text.Name = "Chat"
        Text.BackgroundTransparency = 1
        Text.BorderSizePixel = 0
        Text.Text = "Hey, "..hit.Parent.Name..", when did I suddenly start using grammar?"
        Text.FontSize = "Size36"
        Text.TextColor3 = Color3.new(255,255,255)
        debounce = true -- Activates the wait time debounce
        wait(dbwait) -- When debounce ends (in seconds)
        debounce = false
        ChatBox:Destroy()
        --THIRD CHAT OUTCOME--


        elseif chat == 3 then
        if hit.Parent:FindFirstChild("Humanoid")~=nil then
        local ChatBox = Instance.new("BillboardGui")
        ChatBox.Parent = ball
        ChatBox.AlwaysOnTop = true
        local Text = Instance.new("TextLabel",ChatBox)
        Text.Name = "Chat"
        Text.BackgroundTransparency = 1
        Text.BorderSizePixel = 0
        Text.Text = "no grammar party lets rock"
        Text.FontSize = "Size36"
        Text.TextColor3 = Color3.new(255,255,255)
        debounce = true -- Activates the wait time debounce
        wait(dbwait) -- When debounce ends (in seconds)
        debounce = false
        ChatBox:Destroy()
        --FOURTH CHAT OUTCOME--


        elseif chat == 4 then
        if hit.Parent:FindFirstChild("Humanoid")~=nil then
        local ChatBox = Instance.new("BillboardGui")
        ChatBox.Parent = ball
        ChatBox.AlwaysOnTop = true
        local Text = Instance.new("TextLabel",ChatBox)
        Text.Name = "Chat"
        Text.BackgroundTransparency = 1
        Text.BorderSizePixel = 0
        Text.Text = "enjoi ur fire "..hit.Parent.Name.." okai"
        local fire = Instance.new("Fire",hit.Parent.Torso)
        Text.FontSize = "Size36"
        Text.TextColor3 = Color3.new(255,255,255)
        debounce = true -- Activates the wait time debounce
        wait(dbwait) -- When debounce ends (in seconds)
        debounce = false
        ChatBox:Destroy()
        --FIFTH CHAT OUTCOME--


        elseif chat == 5 then
        if hit.Parent:FindFirstChild("Humanoid")~=nil then
        local ChatBox = Instance.new("BillboardGui")
        ChatBox.Parent = ball
        ChatBox.AlwaysOnTop = true
        local Text = Instance.new("TextLabel",ChatBox)
        Text.Name = "Chat"
        Text.BackgroundTransparency = 1
        Text.BorderSizePixel = 0
        Text.Text = "enjoi ur smoke just kidding aahahhahahahahahahaahha"
        Text.FontSize = "Size36"
        Text.TextColor3 = Color3.new(255,255,255)
        debounce = true -- Activates the wait time debounce
        wait(dbwait) -- When debounce ends (in seconds)
        debounce = false
        ChatBox:Destroy()

        end
        end
        end
        end

    end
end)

Everything went well, the billboard is made, and the text, and they were both put in the ball. The problem is no chat appears. While I was testing on studio, I looked inside the ball's children, and the billboard and text were there, but it still didn't appear. So, why won't it appear?

0
You need to set an adornee (ChatBox.Adornee = ball) TheDeadlyPanther 2460 — 8y

Answer this question