Sorry for the weird title. So I'm developing a script that clones another script, and places it into the designated descendants. I'm doing this because I can just edit one script instead of going to all of the tools localscripts and editing each and every one of them. I test the game, and the cloning script doesn't work. Why? 30 minutes ago, it was working perfectly fine. I have the script enabled, too.
This script is inside a folder, that's inside Lighting. It has a localscript to clone for every tool inside the folder because a tool will possibly get cloned and sent to a players backpack.
local descendants = script.Parent:GetDescendants() if script.Parent then wait(1) for index, descendant in pairs(descendants) do if descendant:IsA("Tool") then local clone = script.LocalScript:Clone() clone.Parent = descendant end end script:Destroy() end
I'm pretty sure everything in the script is correct. If so, can someone please explain to me why it isn't working? If not, tell me what I'm doing wrong. Help is appreciated.