I read api clone and I assume Its not Instance.clone()
as it says on page.
local part = game.Workspace.Part
local ClonedPart = part:Clone()
Great answer! I get how to clone a part now. Can I ask why clone function located after part and colon?
local baseplate = workspace.Baseplate
local clonedBaseplate = baseplate:Clone()
-- I would recommend parenting it if you plan to use the clone lol
clonedBaseplate.Parent = workspace
Hoped this helped
because clone is a built in function and it needs to know what instance it is cloning before running the function.
Edit: same as connecting functions to other stuff like
script.Parent.Touched:connect(function()
end)
This is because you have to declare the part and then call out the instance.
Lua does not have Clone.Part, which makes part:Clone() better.
why would you do parenting? It seems like Baseplate already belongs to workspace in first line.
Because when the clone is created it is not parented.
Please read the api and documents on the devforum before asking questions like this, thanks.
You parent it to make sure it gets in the correct place.
If you do :Clone() it will just get placed in nowhere, which makes the .Parent a useful solution to give your clone a place to be.
The first line is referencing to the already existing Baseplate not the Clone
Got It! Thanks for answering haha.
Mark your solution if you have your answer, in order to avoid this thread being revived.
Lack of knowledge in event yet so pass haha…