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

How to make a button that repeatedly clones a model?

Asked by 4 years ago
Edited 4 years ago

i have the remote event and the button part down, and can make it clone but it only clones the model once instead of repeatedly cloning the model

local unit = game:GetService("ReplicatedStorage"):WaitForChild("Viking"):Clone()

local function cloneUnit(player)
    print(player.Name)

    unit.Parent = workspace
end

2 answers

Log in to vote
0
Answered by
Lunaify 66
4 years ago


local unit = game:GetService("ReplicatedStorage"):WaitForChild("Viking") local function cloneUnit(player) print(player.Name) local unitClone = unit:Clone() unitClone.Parent = workspace end

try this?

Ad
Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago

simple

local function cloneUnit(player)
for i = 1,100 -- 100 is how many times it will be cloned
local unit = game:GetService("ReplicatedStorage"):WaitForChild("Viking"):Clone()

    print(player.Name)

    unit.Parent = workspace
wait(1) -- use this as it will lag the server
end
end
0
Any questions? raid6n 2196 — 4y
0
The idea is that it clones one model for every click of the button, but the button clones the model once and thats it WaterlooBuilder 4 — 4y
0
i see raid6n 2196 — 4y
0
i see raid6n 2196 — 4y
View all comments (3 more)
0
i see raid6n 2196 — 4y
0
is this a local script raid6n 2196 — 4y
0
where is it located raid6n 2196 — 4y

Answer this question