So im trying to make an airdrop script and when i run the script, the object clones and falls to the ground, i set it to repeat so it continually does this but when another object clones, the first one disappears.
Here is my code.
local waittime = (4) local destroytime = (10) local package = game.ServerStorage.Drop local cloned = package:Clone() local DropLocation = game.Workspace.DropZone local Drop = true while true do wait(waittime) package:Clone() print("Cloned") cloned.Parent = game.Workspace cloned.Center.CFrame = game.Workspace.DropZone.CFrame print("Summoned Into Workspace") end
The reason your script is not working is because you only clone the object once, and you repeatedly set the position of the object to the DropZone. The way to fix this is to define your cloned variable inside of the loop:
while true do wait(waittime) local cloned = package:Clone() print("Cloned") cloned.Parent = game.Workspace cloned.Center.CFrame = game.Workspace.DropZone.CFrame print("Summoned Into Workspace") end
What you were doing is cloning the package but not assigning that clone to anything. You were using the initial clone. This new way, however, assigns the cloned object to a new variable each iteration, and we put that into the workspace.
I hope this helps!