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

Why are TextBoxes not showing in ScrollingFrame? [HELP]

Asked by
Shadrz 40
6 years ago

I am an experienced scripter, however there is something I can't figure out. So, I've been trying to figure out why does this happen. When I set up the GUI some of the Text boxes do not show, I have been brainstorming what is wrong with it, I can't figure it out. I am sure it's a problem with scaling, but I definitely could be wrong.

script.Parent.GUI.ScriptGUI.Visible = true
repeat wait() until script.Parent:FindFirstChild("GUI") ~= nil

local shopGUI = script.Parent.GUI.ScriptGUI

local frame1 = shopGUI.Scripts
local frame2 = shopGUI["Scripts2"]

local tab1 = shopGUI.TabScripts
local tab2 = shopGUI["TabScripts2"]

local frame = {frame1, frame2}
local tab = {tab1, tab2}

local currentTab = frame1.Name

local event = game.ReplicatedStorage.RemoteEvent

[local enableEvent = game.ReplicatedStorage.EnableEvent
local disableEvent = game.ReplicatedStorage.DisableEvent](http://)

local setupShop = {"Scripts", "Scripts2"}
local box = shopGUI.ItemBox:clone()
selectedItem = nil

local toggle = true

local lastFrame = frame1 
local lastTab = tab1 

local currentTab = frame1.Name

for i = 1, #tab do
    tab[i].MouseButton1Down:connect(function()
        lastTab.BorderSizePixel = 3 
        lastFrame.Visible = false
        lastFrame = frame[i]
        lastTab = tab[i]
        frame[i].Visible = true
        currentTab = frame[i].Name
        script.Parent.GUI.ScriptGUI.BackgroundColor3 = tab[i].BackgroundColor3
        tab[i].BorderSizePixel = 0
    end)
end

for x = 1, #setupShop do    
local alt = 1
local items = game.ReplicatedStorage.Items[setupShop[x]]:GetChildren()
    for i = 1, #items do
        local newBox = box:clone()
        newBox.Visible = true
        newBox.Parent = shopGUI[setupShop[x]].SelectionFrame
        newBox.Name = items[i].Name
        newBox.Position = newBox.Position + UDim2.new(0, 0, (-0.05) + 0.05*i, 0)
        newBox.Text = items[i].Name
        shopGUI[setupShop[x]].SelectionFrame.CanvasSize = UDim2.new(0, 0, 0.05*i, 0)
        newBox.Check.Visible = false    
        shopGUI[setupShop[x]].SelectionFrame[items[i].Name].MouseButton1Click:connect(function()
            if toggle == true then
            print(items[i].Name.." was clicked")
            local scriptclone = game.ReplicatedStorage.Items[setupShop[x]][items[i].Name].Script:clone()
            scriptclone.Parent = game.Players.LocalPlayer.Backpack
            shopGUI.Visible = false
            event:FireServer(game.Players.LocalPlayer)
            end
        end)
    end
end

Here's the link for what the GUI looks like in the explorer. v Explorer

Answer this question