How can i make search engine in roblox

You have to put my code in the other else.

1 Like
textBox.SH.MouseButton1Click:Connect(function() -- when the text is changed
	local text = textBox.Text:lower() -- lowercase search bar text
	if text ~= "" then -- if it has text
		local buttons = scroll:GetDescendants() -- all of the buttons
		for _, button in pairs(buttons) do -- loops through the buttons
			if button:IsA("TextButton") then -- if it's a button
				local buttonText = button.Text:lower() -- lowercase button text
				if string.find(buttonText, text) then -- if search bar text is found in the button's text
					local GUI = ReplicatedStorage.Websites:Clone()
					GUI.Parent = PlayerGui:WaitForChild("PlayerGui")
				else -- otherwise
					local GUI = ReplicatedStorage.Websites:FindFirstChild(buttonText)
					if (not GUI) then
						print('get 404 page')
							return 
					end

					GUI.Parent = PlayerGui
				end
			end
		end
	else

I already did or wrong

local scroll = script.Parent.Parent.ScrollingFrame -- CHANGE THIS TO YOUR SCROLLING FRAME
local textBox = script.Parent -- CHANGE THIS TO YOUR TEXT BOX
local Players = game:GetService("Players")

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")

textBox.SH.MouseButton1Click:Connect(function() -- when the text is changed
	local text = textBox.Text:lower() -- lowercase search bar text
	if text ~= "" then -- if it has text
		local buttons = scroll:GetDescendants() -- all of the buttons
		for _, button in pairs(buttons) do -- loops through the buttons
			if button:IsA("TextButton") then -- if it's a button
				local buttonText = button.Text:lower() -- lowercase button text
				if string.find(buttonText, text) then -- if search bar text is found in the button's text
				local GUI = ReplicatedStorage.Websites:FindFirstChild(buttonText)
if (not GUI) then
print(“get 404 page” )
return 
end

GUI.Parent = PlayerGui
				else -- otherwise
				
				end
			end
		end
	else -- if it's empty
		local buttons = scroll:GetDescendants() -- all buttons
		for _, button in pairs(buttons) do -- loops through buttons
			if button:IsA("TextButton") then -- if it's a button
			    local sus = ReplicatedStorage.Websites.robloxcom:Clone()
				sus.Parent = PlayerGui:WaitForChild("PlayerGui")
			end
		end
	end
end)
1 Like

I edited it again, try it again.

1 Like

u sure there is a error in print isnt it

print('get 404 page')

why late replies man

didnt work and nothing in output

What do the errors read?

Chars

1 Like

Try it now, there was a missing parenthesis…

1 Like

u know what here take my game file
gooblox.rbxl (110.9 KB)

I’m not currently on my computer at the moment.

1 Like

oh ok but it still doesnt work i had to use

print(`error 404`)

but still broken no output even searching something or roblox doesn’t do anything

Show a screenshot of the code editor.

1 Like


done or here code

local scroll = script.Parent.Parent.ScrollingFrame -- CHANGE THIS TO YOUR SCROLLING FRAME
local textBox = script.Parent -- CHANGE THIS TO YOUR TEXT BOX
local Players = game:GetService("Players")

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")

textBox.SH.MouseButton1Click:Connect(function() -- when the text is changed
	local text = textBox.Text:lower() -- lowercase search bar text
	if text ~= "" then -- if it has text
		local buttons = scroll:GetDescendants() -- all of the buttons
		for _, button in pairs(buttons) do -- loops through the buttons
			if button:IsA("TextButton") then -- if it's a button
				local buttonText = button.Text:lower() -- lowercase button text
				if string.find(buttonText, text) then -- if search bar text is found in the button's text
					local GUI = ReplicatedStorage.Websites:FindFirstChild(buttonText)
					if (not GUI) then
						print('get 404 page')
							return 
					end

					GUI.Parent = PlayerGui
				else -- otherwise

				end
			end
		end
	else -- if it's empty
		local buttons = scroll:GetDescendants() -- all buttons
		for _, button in pairs(buttons) do -- loops through buttons
			if button:IsA("TextButton") then -- if it's a button
				local sus = ReplicatedStorage.Websites.robloxcom:Clone()
				sus.Parent = PlayerGui:WaitForChild("PlayerGui")
			end
		end
	end
end)
local scroll = script.Parent.Parent.ScrollingFrame -- CHANGE THIS TO YOUR SCROLLING FRAME
local textBox = script.Parent -- CHANGE THIS TO YOUR TEXT BOX
local Players = game:GetService("Players")

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")

textBox.SH.MouseButton1Click:Connect(function() -- when the text is changed
	local text = textBox.Text:lower() -- lowercase search bar text
	if text ~= "" then -- if it has text
		local buttons = scroll:GetDescendants() -- all of the buttons
		for _, button in pairs(buttons) do -- loops through the buttons
			if button:IsA("TextButton") then -- if it's a button
				local buttonText = button.Text:lower() -- lowercase button text
				if string.find(buttonText, text) then -- if search bar text is found in the button's text
					local GUI = ReplicatedStorage.Websites:FindFirstChild(buttonText)
					if (not GUI) then
						print('get 404 page')
							return 
					end
local GUI = GUI:Clone()
					GUI.Parent = PlayerGui
				else -- otherwise

				end
			end
		end
	else -- if it's empty
		local buttons = scroll:GetDescendants() -- all buttons
		for _, button in pairs(buttons) do -- loops through buttons
			if button:IsA("TextButton") then -- if it's a button
				local sus = ReplicatedStorage.Websites.robloxcom:Clone()
				sus.Parent = PlayerGui:WaitForChild("PlayerGui")
			end
		end
	end
end)
1 Like

You forgot to clone it, here try this.

1 Like

double checking … didnt work did i do something wrong I pasted it correctly /:

Send another screenshot…

Characters.

1 Like

local scroll = script.Parent.Parent.ScrollingFrame -- CHANGE THIS TO YOUR SCROLLING FRAME
local textBox = script.Parent -- CHANGE THIS TO YOUR TEXT BOX
local Players = game:GetService("Players")

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")

textBox.SH.MouseButton1Click:Connect(function() -- when the text is changed
	local text = textBox.Text:lower() -- lowercase search bar text
	if text ~= "" then -- if it has text
		local buttons = scroll:GetDescendants() -- all of the buttons
		for _, button in pairs(buttons) do -- loops through the buttons
			if button:IsA("TextButton") then -- if it's a button
				local buttonText = button.Text:lower() -- lowercase button text
				if string.find(buttonText, text) then -- if search bar text is found in the button's text
					local GUI = ReplicatedStorage.Websites:FindFirstChild(buttonText)
					if (not GUI) then
						print('get 404 page')
						return 
					end
					local GUI = GUI:Clone()
					GUI.Parent = PlayerGui
				else -- otherwise

				end
			end
		end
	else -- if it's empty
		local buttons = scroll:GetDescendants() -- all buttons
		for _, button in pairs(buttons) do -- loops through buttons
			if button:IsA("TextButton") then -- if it's a button
				local sus = ReplicatedStorage.Websites.robloxcom:Clone()
				sus.Parent = PlayerGui:WaitForChild("PlayerGui")
			end
		end
	end
end)

image

If you are converting all input text to lowercase, then the website names must also be ok lowercase.

1 Like

Change your roblox website in your folder to lowercase, and then test it.

1 Like