How can i make search engine in roblox

Hello guys im making a game like google that can search anything I putted but
I don’t know how I’m just new at scripting and I tried to find on yt or other but I have this script maybe is good?

local scroll = script.Parent.Parent.ScrollingFrame -- CHANGE THIS TO YOUR SCROLLING FRAME
local textBox = script.Parent -- CHANGE THIS TO YOUR TEXT BOX

textBox.Changed: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
					button.Visible = true -- shows button
				else -- otherwise
					button.Visible = false -- hides button
				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
				button.Visible = true -- shows button
			end
		end
	end
end)
1 Like

pls anyone??? cmon dude!!!

1 Like

What is it you want exactly?

A text box that when a text gets entered a web page with the same name as the text gets shown?

Sorry if this is worded weird, I just woke up lol.

if you’re a new scripter then this is a horrible thign to start out with tbh. its extremely complicated, and it may not even bhe possible without inputing everysingle possible series of character that can be searched

3 Likes

The OP could have a list of websites and a 404 error page, so when someone looks for a website they don’t have, then the 404 would be displayed.

Plus it’s not really they complicated? A simple lower text check and enable a UI if the text matches.

1 Like

yeah u can literlyy see textbox in the code sorry for late reply man.

Go figure, but that’s not what I was referring to.

2 Likes

Oh! Do you want a search system like a player search system?

2 Likes

like google and other one of those


sorry for the bad UI I know little coding I’m a beginner and can maybe do some easy coding like not all

Never mind my judgement was correct.

So the easiest method would be:

  • Have a folder of “websites” UIs in ReplicatedStorage (or wherever you choose to be your directory).

  • When the player inputs text and enters, we compare the text to the list of websites we have.

  • If a match is found copy and display said website, else display the 404.

3 Likes


it works but its not good when i have to keep add more I want to make like a place to add links and remove online without having to add

thats cool il try that! if i can

Alright let me know how it goes, or if you need assistance when anything listed.

1 Like

wait how can i copy and move the gui into where I want? i don’t know how I can ):

im confused i tried to see how but i don’t know how I can delete the button

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
					script.AdminGUI:Clone() -- does it
					button.Parent = Players:WaitForChild("PlayerGui")
				else -- otherwise
					 -- hides button
				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
				button.Visible = true -- shows button
			end
		end
	end
end)

still no anwser

This is how you clone and parent.

local GUI = YOURGUI:Clone()
GUI.Parent = PlayerGui
2 Likes

well i have a issue if i dont use the button local the search engine might not work
image
well the thing didn’t show

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:Clone()
					GUI.Parent = PlayerGui:WaitForChild("PlayerGui")
				else -- otherwise
					local GUI = ReplicatedStorage.Websites.robloxcom:Destroy()
					GUI.Parent = PlayerGui:WaitForChild("PlayerGui")-- hides button
				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

what am i doing wrong im so confused man I am bad

You have to find the website.

local GUI = ReplicatedStorage.Websites:FindFirstChild(buttonText)
if (not GUI) then
print(“get 404 page” 
return 
end

GUI.Parent = PlayerGui
1 Like

now what i did it what next what sould I now do coz it still ain’t working

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: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 -- 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)