Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a script that clones a model from Lighting on to a part in Workspace?

I tried this before but it didn't work, so can you please help me? Just give me an example script with the model named Thing and the part named Spawner. Make the wait time before it clones the model to 150. This would help me a lot for making my game and it wouldn't be very hard to use.

2 answers

Well from considering you said the wait time to 150, I'm guessing you want it to repeat. To make this easier for you I'd recommend positioning the object before placing it in Lightning. I'll still do what you requested.

a = game.Lighting.Thing
b = game.Workspace.Spawner

while true do
	c = a:clone()
        c.Parent = game.Workspace
	c:MoveTo(b.Position,)
	wait(150)
	--if game.Workspace:findFirstChild("Thing") then game.Workspace.Thing:Destroy()
	--end
end

~ Thank me by accepting this answer/bumping up my reputation!

4 comments

0

Thanks!

0

No problem. Help me out by accepting this answer.

0

This didn't actually clone it to the part's position.

0

Try now?

local part = script.Parent
local Thingy = game.Lighting.Thingy

local debounce = true
part.Touched:connect(function()
if debounce == true then
debounce = false
local Thingy = Thingy:Clone()
    wait(1)
    Thingy.Parent = Workspace 
    wait(120)
debounce = true
end
end)




You could try this as well. It clones it wherever you cut it from the Workspace.

This discussion is preserved as it was. New answers, comments, and votes are closed.