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

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

Asked by 10 years ago

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

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

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!

0
Thanks! flamenathan327 20 — 10y
0
No problem. Help me out by accepting this answer. Shawnyg 4330 — 10y
0
This didn't actually clone it to the part's position. flamenathan327 20 — 10y
0
Try now? Shawnyg 4330 — 10y
Ad
Log in to vote
0
Answered by 10 years ago
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.

Answer this question