i'm making a script that people can put in models they can insert, but since there might be more than two inserted models with the same script (and i want this script to be placed in workspace instead of the model that it came with, just for ease of use and convenience), but if i just parent it to workspace, there will be two of them, and i can't delete the one that already exists because that would break the whole system, i'm currently using this set of lines of code (code block below), but it doesn't seem to be working as i'd want it to (it just doesn't parent itself to workspace at all regardless if there's already another one in there)
can anyone help me with this?, if you can, i'd be very thankful
(NameOfScript is the name of the script for testing)
b = workspace:FindFirstChild("NameOfScript")
if b ~= nil then
script.Parent = workspace
end
--(rest of the script is below)

2 comments
what is this script parented to before being parented to workspace?
it is parented to the model that was inserted