GUI visibility on many part clicks

I am trying to make a Decal Post area where when you click a part a GUI appears with the image upload bar and you would be able to upload these to the part. I have about 40 part models and whenever you click on any part the same GUI would appear and upload it to the part they clicked on. How would I achieve this? (I actually got a developer to do this but they didn’t know-how and scammed me of 500R$)
Script:

local text = script.Parent.Parent:WaitForChild("TextBox")
local decal = game:GetService("Workspace").Part:WaitForChild("DecalParts"):GetChildren("DecalPart")
local click = decal.ClickDetector
local event = game:GetService("ReplicatedStorage"):WaitForChild("decal1")

click.MouseClick:Connect(function()
	script.Parent.Parent.Visible = true
end)
script.Parent.MouseButton1Down:Connect(function()

		local textid = text.Text
	
		event:FireServer(textid)
end)

Workspace: Workspace5 WOrkspace4
Script inside DecalPart:

local event = game:GetService("ReplicatedStorage"):WaitForChild("decal1")

local function decal(player, text)
	local decal = script.Parent.Decal
	
	decal.Texture = "https://www.roblox.com/asset-thumbnail/image?assetId="..text.."&width=420&height=420&format=png"
end

event.OnServerEvent:Connect(decal)

Any help is satisfactory!

Can you be a bit more specific from what you are trying to do? Are you trying to make a Bulletin GUI appear when the player clicks on this said part. (if so, you wouldn’t need a remote event to execute this, unless you want every player in your game to see the upload GUI that a player clicked on.)

They are all decal upload parts.

So what you are basically trying to do is have a player click any one of them, a GUI opens up, then they can post any decal the wish to?

Yes they can upload any decal visible to all players and when they leave it stays there until someone else rewrites it. (If they are in game then nobody can rewrite).

I see you already have your GUI, so what you need to do is create a script under each block that fires a remote event under ReplicatedStorage (in fact, create two remote events, one for telling the client to show the GUI, and one to upload the GUI to the server) to the client using the data obtained from the “clicked” event. (pass through the player who clicked)

In the local scripts under your “rent” GUI, you’re going to have to create an event listener that fires when the RemoteEvent fires to the client. When this function is fired, enable the GUI’s, and wait until the player uploads the GUI. When they do, fire the RemoteEvent that passes the decal’s ID through a parameter back to the server script.

In the same server script that fired the event, create another event listener that fires when the “upload event” is fired by any client. Using the parameters passed, change the brick’s decal.

1 Like

Thanks, I will try this in a moment and be sure to let you know the results! (I will mark this solved when that happens)

1 Like