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

Cloning by GUI

Asked by 10 years ago

This will be the last thing I will need help with for the game I am building. Thank you to whoever helped with the "Remove a Chair by GUI" Topic. On this Script it's supposed to regen the Chairs back when you click on the GUI but there are some errors on the line.

local Model = Workspace.Set.FutureChair

script.Parent.MouseButton1Down:connect(function()
    local ModelCopy = Model:Clone()
    ModelCopy.Parent = Workspace.Set
    wait()
end

2 answers

Log in to vote
1
Answered by 10 years ago
local Model = Game:GetService("ServerStorage"):FindFirstChild("FutureChair");

script.Parent.MouseButton1Down:connect(function() 
Model:Clone().Parent=Workspace.Set;
end);

Just put your model named FutureChair in ServerStorage.

0
Doesn't work. xXScorpianKillerXx 25 — 10y
0
The script provided should work, to my understanding (I didn't personally test it, but I did go over it a few times and didn't see any errors). Are you sure everything is named correctly, and that this is inside of your TextButton/ImageButton/etc? User#2 0 — 10y
Ad
Log in to vote
1
Answered by
TomsGames 225 Moderation Voter
10 years ago
local model = game:GetService("ReplicatedStorage"):FindFirstChild("FutureChair")

script.Parent.MouseButton1Down:connect(function()
model:clone().Parent = Workspace.Set
end)

Put it inside replicatedstorage. From this, local scripts can access it.

0
I put the Chairs into ReplicatedStorage, but it didn't work xXScorpianKillerXx 25 — 10y

Answer this question