Sorry, I had posted a question similar to this and did what the answer pertained yet it still didn't change this touch regen into a click regen. Yes I did add a click detector.
local box = script.Parent
local debounce = false
local everything = {model}
local names = {model}
local children = game.Lighting:children()
for i=1,#children do
if (children[i].Name == "Tech") then
table.insert(everything, children[i]:clone())
table.insert(names, children[i].Name)
end
end
function regen()
for i=1,#everything do
game.Lighting:findFirstChild(names[i]):clone()
new_thing = everything[i]:clone()
new_thing.Parent = game.Workspace
new_thing:makeJoints()
end
end
function onTouched(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if humanoid~=nil and debounce == false then
debounce = true
script.Parent.BrickColor = BrickColor.new(1020)
regen()
wait(102)
script.Parent.BrickColor = BrickColor.new(1020)
debounce = false
end
end
script.Parent.Touched:connect(onTouched)

2 comments
please put everything in a code bock not just that section
Also, findFirstChild() is deprecated use FindFirstChild()