i already have a working script to create a part but i dont have any working script to delte it again im using two click detectors + scripts to activate the scripts one for creating the part and one for delteing it again im sitting on this for 7 hours now but i just can get the deleting script to work anyways heres the script to spawn the part:
function spawnlte2brick (Click)
local part = Instance.new("Part")
part.Position = Vector3.new (-194.232,4.732,-2.5)
part.Parent = game.ServerScriptService.lte2brickstorage
part.Color = Color3.new(0.639216, 0.635294, 0.647059)
part.Name = "lte2birck"
part.Material = Enum.Material.Plastic
part.Orientation = Vector3.new (0,0,-45)
part.Anchored = true
part.Size = Vector3.new(13,1,7)
end
script.Parent.MouseClick:Connect(spawnlte2brick)
solved my question i used this script
function deletelte2brick (Click)
while true do
local found = workspace.lte1buttonscript:FindFirstChild("lte2brick")
if found then
workspace.lte1buttonscript:ClearAllChildren()
wait(0.2)
end
end
end
game.Workspace.lead_to_exit1_button.ClickDetector.MouseClick:Connect(deletelte2brick)

1 comment
please be more detailed i dont quite understand