Hi! :3
I have an empty script (that will fill later) inside Replicated Storage.
I also have the parts that will contain the Script inside Rep. Storage.
With the following code I’m trying to add the script to each of the parts that have a “Lights1” or “Lights2” tag.
--Variables
tagService = game:GetService("CollectionService")
replicatedScripts = game.ReplicatedStorage.DecorScripts
taggedPartsLightPrimary= tagService:GetTagged("Lights2")
taggedPartsLightSecondary = tagService:GetTagged("Lights1")
--Adds Primary Lights Music script to tagged Parts
for index, part in ipairs(taggedPartsLightPrimary) do
local clonedScript = replicatedScripts.LightMusicPrimary:Clone()
clonedScript.Parent = part
end
--Adds Secondary Lights Music script to tagged Parts
for index, part in ipairs(taggedPartsLightSecondary) do
local clonedScript = replicatedScripts.LightMusicSecondary:Clone()
clonedScript.Parent = part
end
Are the parts will belong to local player once cloned. So, with everything set, Both scripts clone, but in the wrong place.
They should clone inside each “Lights1 / Lights 2” of each “Building”. But are getting clonned directly as you can see inside “Buildings” group.
Any help would be appreciated
If I ever add credits to the game or something, will include your support :3