I am making a pirate game and when I click the regen button to spawn another ship more than once I get an error like this:
The Parent property of SloopCopytwo is locked, current parent: NULL, new parent Workspace
So it does not work more than once and don't know how to fix this issue It also does not clone multiple of the same ship like I would like it too here is my script for the ship spawner.
game.ServerStorage.smallshiptwo.Archivable = true
copy = game.ServerStorage.smallshiptwo:clone()
game.ServerStorage.smallship.Archivable = false
local detector = game.Workspace.Regensloop
script.Parent.ClickDetector.MouseClick:Connect(function()
copy.Parent = game.Workspace
copy.Name = "SloopCopytwo"
copy:MoveTo(Vector3.new(152, 2.5, -90))
end)
thanks.

2 comments
Why is it not Archivable in the first place? And also the model may have been garbage-collected, since I see that the parent are set only if the ClickDetector is Triggered.
@NotThatFamouss how do I fix that?