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

How do I use Clone() instead of lighting?

Asked by
NecoBoss 194
10 years ago

Okay so I get how to use game.Lighting as storage but I don't know how to use clone(). Please explain how to use clone().

2 answers

Log in to vote
1
Answered by
hudzell 238 Moderation Voter
10 years ago

Clone()ing is like copying and pasting, I'll show you an example

local buttonPart = script.Parent

buttonPart.Touched:connect(function(hit) --Waits for the button part to be touched
    if hit.Parent:FindFirstChild("Humanoid") then --If a player hit it, then continue
        local clonePart = game.Lighting.Part:Clone() --Cloning the part
        clonePart.Parent = Workspace --Placing the part in the Workspace
        wait(5) --Waiting to destroy the part
        clonePart:remove() --Destroying the part
    end
end)

And you can modify all of the proprieties of the part like you would normally with a script, just make sure you put clonePart before you change a property.

0
You really should use :Destroy(), not :remove() gskw 1046 — 10y
0
Why? haha, they both do the same thing. hudzell 238 — 10y
Ad
Log in to vote
-3
Answered by 10 years ago

Ill give you an example:

game.Lighting.Minigame1:clone().Parent = game.Workspace

IN order for this to work, you have to place the Model or Part in Lighting in order for a script like this to work. P.S. It has to be EXACTLY named the same in the script and in Lighting for it to work.

Answer this question