I tried different ways to delete a model from workspace but it wont work, here is the script that will not do anything. Anything will help like any roblox scripting support links I have not looked at.
function spawnmodel() for k,v in pairs(workspace:GetChildren()) do if string.find(v.Name:lower(), "TestModel") then v:Destroy() end end end script.Parent.MouseButton1Down:connect(spawnmodel)
function spawnmodel() game.workspace[modelname]:Destroy() end script.parent.MouseButton1Down:Connect(spawnmodel)
I dont know exactly what you're looking for. Try this?