Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

:Clone() does not duplicate tools?

Asked by
GShocked 150
8 years ago
Edited 8 years ago

I have a script that duplicates a folder of stuff - models, other folders, scripts, etc. The problem is, using :Clone() does not duplicate tools and leaves those behind, as shown in the video below.

Video: https://i.gyazo.com/b3ef1f10ad63c0defd2389bc1c50eb5b.mp4

How can I fix this?

EDIT: Here's a screenshot of where the tools are coming from: https://i.gyazo.com/f9698eda8a8fd057c7ba3d472546f96e.png

Here's my code:

local terrainSaveLoad = require(game.ServerScriptService.TerrainSaveLoad)
local maps = game.ServerStorage.Maps

while true do
    terrainSaveLoad:Load(maps.Village.Terrain)
    Village = maps.Village.Village:Clone()
    Village.Parent = workspace
    wait(15)
    workspace.Terrain:Clear()
    Village:Destroy()
    wait(5)
end

EDIT2: Well I tested the same exact part hierarchy and the problem did not appear, so I'm not sure what's causing this. https://i.gyazo.com/c7d7570353127c419e32a72b2345e470.png

I also tried grouping the tools by themselves and that seemed to copy over correctly. It seems to be one of those random Roblox glitches I always get myself into.

0
I'm kind of lost on what is happening... You have a script that wont duplicate tools with clone yet 5 apple tools appear in serverstorage? Is the problem them not going to a different parent? alphawolvess 1784 — 8y
0
Yes, I forgot to add that it moves the duplicated parts to `workspace`. So I guess this problem is probably something going wrong when I change the `Parent` of the duplicated parts. I've added some code for further clarification. GShocked 150 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

maybe you need to be more specific.. because the script won't know where should you put the village in because the script doesn't know where is workspace located at... so.. You need to add game.Workspace in the Village.Parent ..

If you don't understand just take a look at this script v


local terrainSaveLoad = require(game.ServerScriptService.TerrainSaveLoad) local maps = game.ServerStorage.Maps while true do terrainSaveLoad:Load(maps.Village.Terrain) Village = maps.Village.Village:Clone() Village.Parent = game.Workspace wait(15) workspace.Terrain:Clear() Village:Destroy() wait(5) end
1
game.Workspace is still correct, but using just workspace has also been correct syntax for a few years now. I tested just to be sure, and this did nothing. My problem still exists. GShocked 150 — 8y
Ad

Answer this question