If the value for lastbrickspawned was brick288. Then it would have destroyed brick288 in workspace.
local bricktodelete = script.Parent.Parent.Parent.BottomBar.Models.LastBrickSpawned.Value script.Parent.MouseButton1Down:Connect(function() workspace.bricktodelete:Destroy() end)
You would use an if statement to see if the condition is met. In this case, if the value is equal to 'x', delete the brick.
local brick = game.Workspace.Your_Brick local bricktodelete = script.Parent.Parent.Parent.BottomBar.Models.LastBrickSpawned.Value script.Parent.MouseButton1Down:Connect(function() if bricktodelete == "brick288" then brick:Destroy() end end)