-
What do you want to achieve?
Want to have a script that’s able to clone 1 script into different parts.
-
What is the issue? Include screenshots / videos if possible!
the script works in terms of cloning, however. It clones it into 1 random part and not all of them
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
there doesn’t seem to be any one talking about this, so here might be the best place.
wondering where the script is?
local IC_Script = script.Parent.Ice_Changer--this one works fine
local Ice_Floor = game.Workspace.Ice_Floor:GetChildren()
local function CloneIceScript()
local ScriptClone = IC_Script:Clone()
ScriptClone.Parent = game.Workspace.Ice_Floor.Ice
for i,Cloned in pairs(Ice_Floor) do--there isn't an issue here it works fine but, it more has to due with it not cloning the script into each part
if game.Workspace.Ice_Floor:IsA("BasePart") then
CloneIceScript()
end
end
end
CloneIceScript()
--pretty much stuck on this
do not write entire scripts or design entire systems.
Are you sure it works? Why did you put game.Workspace.Ice_Floor
? Shouldn’t you be checking Cloned
instead?
Also, is your goal to put the script in each Ice part or each Ice_Floor model
yes it is the goal to do so, clone each script into a part, also yes it dose work it just that, it only clones the script 1 times into 1 random ice part. and I have tried moving and adjusting the script and still it dose the same thing.
the goal is to put the script in every ice part?
yes that’s the goal, ik that you can just copy and paste the script into each part (which would mean this post was made for nothing, however) because I’m gonna to have a ton of parts, I want to do it the easier way instead of the long way.
The reason for this is this is a minigame, I’m making a zamboni minigame where the goal is to clean the ice in a ice rink.
You could just do this
local IC_Script = script.Parent.Ice_Changer
local Ice_Floor = game.Workspace.Ice_Floor:GetChildren()
local function CloneIceScript()
for i,Cloned in pairs(Ice_Floor) do
if Cloned:IsA("BasePart") then -- Cloned is the ICE part
if Cloned:FindFirstChild('Ice_Changer') ~= nil then -- If the part already has the script, it skips it so it won't have 2 scripts in 1 part
else -- If it doesn't have one
local ScriptClone = IC_Script:Clone()
ScriptClone.Parent = Cloned -- Puts it in the ice part
end
end
end
end
CloneIceScript()
already you just fixed it for me, this is what I needed, thanks ![:slight_smile: :slight_smile:](https://doy2mn9upadnk.cloudfront.net/images/emoji/twitter/slight_smile.png?v=12)
No problem! (.mm.char limit…mm)
1 Like