I am trying to make the search button find a specific name in all the pages
Error: 12:50:51.420 - Players.Player1.PlayerGui.Paid Winners GUI.Main.Main:26: attempt to call method 'GetChildren' (a nil value) 12:50:51.421 - Stack Begin 12:50:51.423 - Script 'Players.Player1.PlayerGui.Paid Winners GUI.Main.Main', Line 26 12:50:51.424 - Stack End
Code:
local allpages = {page1, page2, page3, page4, page5, page6, page7, page8, page9, page10}
local searchbox = script.Parent:WaitForChild("SearchText")
local searchbutton = searchbox:WaitForChild("Click")
searchbutton.MouseButton1Click:connect(function()
for i,v in pairs(allpages:GetChildren()) do
if v.Text == searchbox.Text then
searchbox.Text = "Player has been paid!"
searchbox.TextColor3 = Color3.fromRGB(0,200,0)
wait(1.5)
searchbox.Text = "Search..."
searchbox.TextColor3 = Color3.fromRGB(95,95,95)
end
end
end)

2 comments
Pretty sure you can't call GetChildren on a table. GetChildren returns a table of the objects descendants.
How do i get all the objects in each of the pages then?