Basically i have more than one banner in the workspace, and i want this script to animate them. This script is not in workspace.

function Module:Ads()
    print("ADVERTISMENT")

    --< Getting the Advert boards
    local AdvertBoardLocations  = workspace.Game.AdvertBoards
    local Children              = AdvertBoardLocations:GetChildren()

    for i = 1, #Children do
        if Children[i]:IsA('Model') and Children[i].name == "SmallBannerAd" then

            --< variables
            local Display1 = Children[i].Screen.SurfaceGui.Frame.Display1
            local Display2 = Children[i].Screen.SurfaceGui.Frame.Display2   

            local using = Display1

            --< dialogue
            local Display = 
            {
                "rbxassetid://1577225448", 
                "rbxassetid://1577224943", 
                "rbxassetid://1577225448", 
                "rbxassetid://1577224943"
            }

            warn("GOT IDS")

            --< move function (tween)
            local function move(obj, pos)
                obj:TweenPosition(pos, "Out", "Quad", 1)
            end


            while true do
                --< dialogue runner (for loop)
                for s = 1, #Display do

                    warn("TWEENED")

                    --< reposition, change text, and move current label onto screen
                    using.Position = UDim2.new(-1, 0, 0, 0)
                    using.Image = Display[s]
                    move(using, UDim2.new(0, 0, 0, 0))

                    --< prepare next label
                    if using == Display1 then
                        using = Display2
                    else
                        using = Display1
                    end

                    --< move old/next label off the screen
                    move(using, UDim2.new(1, 0, 0, 0))

                    wait(2)
                    warn("WAITED")
                end
            end
        end
    end
end 

2 comments

0

name is deprecated, use Name

0

"Why is this happening to only one banner?" mind defining "this"??