So… Im just started today to make scripts (ive seen alvinblox for 1 month 00f) And i made a loop script (The loop make a part and too a sparkle) now whats my problem?
Problem: I want to parent the sparkle to each part the loop create
When posting code to the DevForum, please include your code in a code block. You can accomplish this by using three back ticks and posting your code between them.
```lua
-- Your code
```
Just a note that you’d probably want to create the assets first before setting their parents.
while true do
local part do
part = Instance.new("Part")
part.Name = "Orange" -- And all your other properties, EXCEPT PARENT
end
local sparkles do
sparkles = Instance.new("Sparkles")
end
sparkles.Parent = part
part.Parent = workspace.Orange
wait(0.5)
end
It’s always good practice if you set properties first before the parent, so you can avoid any odd issues arising out of the cause of what order you parent things in. You should also parent children first before the actual part itself (i.e. the sparkles).