Alright, hello random people on the internet who are trying to steal my roblox account!
So my problem/concept is: How the heck can i make a searchable GUI. Because i decided to take one last attempt at making a sandbox tycoon, i wanted to add a searchable inventory/shop, how would i attempt this?
What i would guess to search a GUI would be, i would be using a text box fyi: if string.match(TextBox.Text, --[[I dont know what to put here]])
How could i make a searchable gui?
My current code (Client):
local building = require(game.ReplicatedStorage.Modules.Building)
local info = script.Parent.Info
local template = script.Parent.Template
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local classbuttons = script.Parent.Frame
local preview
local moveconnection
local move = function()
end
local removetemplate = function()
end
local addtemplate = function(object)
local class = object:WaitForChild("Class")
local newtemplate = template:Clone()
newtemplate.Item.Value = object
newtemplate.ImageTransparency = 0
newtemplate.NameLabel.Text = object.NameString.Value
newtemplate.NameLabel.TextTransparency = 0
if class.Value == 1 then
newtemplate.Parent = script.Parent.Folder.Building
elseif class.Value == 2 then
newtemplate.Parent = script.Parent.Folder.Decoration
elseif class.Value == 3 then
newtemplate.Parent = script.Parent.Folder.Money
elseif class.Value == 4 then
newtemplate.Parent = script.Parent.Folder.Worker
end
newtemplate.MouseButton1Click:Connect(function()
print(object.Description.Value)
script.Parent.CurrentObject.Value = object
info.Description.Text = object.Description.Value
info.Price.Text = object.Cost.Value
info.ItemName.Text = object.NameString.Value
info.ItemImage.Image = "rbxassetid://"..object.Image.Value
end)
end
for i, v in pairs(classbuttons:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
local class = v.Class
if class.Value == 1 then
script.Parent.Folder.Building.Visible = true
script.Parent.Folder.Decoration.Visible = false
script.Parent.Folder.Money.Visible = false
script.Parent.Folder.Worker.Visible = false
elseif class.Value == 2 then
script.Parent.Folder.Building.Visible = false
script.Parent.Folder.Decoration.Visible = true
script.Parent.Folder.Money.Visible = false
script.Parent.Folder.Worker.Visible = false
elseif class.Value == 3 then
script.Parent.Folder.Building.Visible = false
script.Parent.Folder.Decoration.Visible = false
script.Parent.Folder.Money.Visible = true
script.Parent.Folder.Worker.Visible = false
elseif class.Value == 4 then
script.Parent.Folder.Building.Visible = false
script.Parent.Folder.Decoration.Visible = false
script.Parent.Folder.Money.Visible = false
script.Parent.Folder.Worker.Visible = true
end
end)
end
end
for i, v in pairs(player.Inventory:GetChildren()) do
if v:IsA("Folder") then
local amount = v:WaitForChild("Amount")
local object = v:WaitForChild("Object")
local curamount = amount.Value
amount:GetPropertyChangedSignal("Value"):Connect(function()
local newamount = amount.Value
if newamount > 0 then
print(newamount.." "..curamount)
curamount = newamount
print("Curamount: "..curamount)
addtemplate(object.Value)
end
end)
end
end

1 comment
Thank you, ill look into this.