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

Moving models to ReplicatedStorage?

Asked by 6 years ago
Edited 6 years ago

How do you move models from Workspace to ReplicatedStorage? Is it possible? I want to do it using a SurfaceGui TextButton.

function onButtonClicked()
local model = game.Workspace.model:Clone()
model.Parent = replicated
end


script.Parent.MouseButton1Down:connect(onButtonClicked)

I know that's wrong and I'd like to get a correct version.

0
Please use a Code block it makes it easier for us to understand the code. Timmerman73 85 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

Try this

function onButtonClicked() 
local Model = game.Workspace.model:Clone()
Model.Parent = game.ReplicatedStorage 
end

script.Parent.MouseButton1Down:connect(onButtonClicked)

If u want it to disappear from workspace then try this...

function onButtonClicked() 
local Model = game.Workspace:FindFirstChild(“model”)
If Model then
  Model.Parent = game.ReplicatedStorage 
end
end

script.Parent.MouseButton1Down:connect(onButtonClicked)
Ad

Answer this question