Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Clone lights into parts help?

Ok so like I have a clone pointlight and I want to clone it and put it in everyblock but idkdkkdkd

local Lights = game.Workspace.Flashies:GetChildren()

for i = 1, #Lights do
	local AddLight = Lights.Clone.PointLight:Clone()
	AddLight.Parent = Lights[i]
	wait(1)
end

1 comment

0

when you say every part, do you mean every part in the Flashies model or every part in the game?

2 answers

Little confused by your question, but if you want the light to be cloned into every part named something or other, this script is for you!

p = game.Workspace:getChildren()
for i=1, #p do
	if p[i].Name == "Part" then
		light = game.Workspace.Flashies:Clone()
		light.Parent = p[i]
		light.Name = "Light"
	end
end

change the "Part" to whatever part name you want and it will add the light to every said part.

local Lights = game.Workspace.Flashies:GetChildren()

for i ,v in pairs(Flashies) do
    local AddLight = Lights.Clone.PointLight:Clone()
    AddLight.Parent = v
    wait(1)
end

If you have any mistakes in your script, it would be in line 4. the script looks fine to me, but maybe you're making the wrong reference to an object. could you post an error so I know what's wrong?

This discussion is preserved as it was. New answers, comments, and votes are closed.