Help with Scripting

Hi Everyone . I just want to know is there any way to like As soon as I touch the part it makes a clone of himself. Thanks ! .

1 Like

When you say, himself, the player or the part?
Use the touched function then :Clone

1 Like
part.Touched:Connect(function()
part:Clone().Parent = part.Parent
end)
2 Likes

Oh I mean the part. Well I was confused there . Thanks

Thank You Ben . That’s exactly what i was looking for

So (Yourpart).Touched:Connect(function(part)
part:Clone().Parent (Define the parent) == workspace

Btw why are the parenthesis are for after typing (function()

The parent can be named anything. Heres an example script with a part named tihi

script.Parent.Touched:Connect(function(tihi)
script.Parent:Clone().Parent == workspace

I actually am not sure.

I just realized that the code I gave you was wrong, I fixed it now so it should work now. Copy the new one.

why do you type tihi like ? is it the name of the function?

Tihi is the name of the part, just a random name

Oh okay. I just understand the code and made my own . It works. Thank you both of you. I don’t really like to copy when scripting xD

Do you always have to type something there ? or you can leave it empty ?

You can leave it empty if you don’t have anything to do with the parameters the event returns when fired.

You can leave it empty (like @BenMactavsin said)

Is there any way to make a specific number of clones . Like 7 clones.

well to put a random amount you could use math.Random(1,7)
using random, if you wanted 7 you could use math.Random(7,7)