function AddClickDetector(object)
if object:IsA("Part") or
	object:IsA("UnionOperation") then
	local clicker = game.ServerScriptService.ClickDetector:Clone()
	clicker.Parent = object
end
for _, child in ipairs(script.Parent.MapPart:GetChildren()) do
	AddClickDetector(child)

end
end

AddClickDetector(script.Parent.MapPart)

The script is supposed to clone the "ClickDetector" in "ServerScriptStorage". Then It is supposed to put the clone in the parts of the map (In the folder called "MapPart") Any ideas why the script isn't working? No errors are shown in the output.

1 comment

0

Please learn how to tab your code correctly. I believe the scripting glossary in this website talks of Tabbing.