Help trying to find an model with a gui

So I just cant find anywhere how to do this so im asking here. I have no idea where to start on this.
I have a gui that is supposed to change a text on a surface gui of a stall. I have it so in the stall has a part in the with a Value called owner thats the players id. Is there a way to have the script cycle through every stall (Stall1, Stall2 and on) and then find the value and check if it matches the players id which I have stored in the player as another value. Then change the text to whatever is typed in the box. Or if possible have a way to make it so it doesnt have to cycle through everytime and somehow the gui and the stall are connected?
screenshots:
image
image
image
image

im assuming you’re asking how to see if a value on each stall corresponds with the players id?
by the way, i wrote this in like 30 seconds as i’m just trying to show you the concept, not the actual code you should put in the game.

the way i’d do it is by putting every stall in a folder, then iterating through it. something like this:

yes2

now imagine each stall as Part1, Part2, and Part3.
now, i just have to check if the stalls match with the playerId, but im making this very quickly so i’ll just check the player name.

so, i’ll iterate through every stalls name value and check if it matches mine, like this

local playername = game.Players.LocalPlayer.Name

local children = workspace.Folder:GetChildren()
for i = 1, #children do
	if (children[i].PlayerName.Value.Value == playername)
	then
		print("you can change stall name")
	end
end

so essentially, you can just iterate through every stall in a folder and check if it matches a players id, then from there, let the player customize the shop name. this is just a concept of how you can do it so dont use my actual code

1 Like