GetDecendants is not a valid member of Model

its just saying this

local function Dirupt(Detector)
	local Search = Detector.Parent
	local Lights = {}
	
	for _, V in Search:GetDecendants() do -- HERE
		if V.Material == "Neon" and V:FindFirstChildOfClass("PointLight") or V:FindFirstChildOfClass("SpotLight") or V:FindFirstChildOfClass("SurfaceLight") then
			table.insert(Lights, V)
		end
	end
	
	local Times = math.random(1, 4)
	local Doin = false


	Doin = true

	task.spawn(function()
		while Doin == true do
			for _, V in Lights do
				V.SpotLight.Enabled = false
				V.PointLight.Enabled = false
				V.Color = Color3.fromRGB(0, 0, 0)
				task.wait(tonumber("0.0"..math.random(1, 9)))
				V.SpotLight.Enabled = true
				V.PointLight.Enabled = true
				V.Color = Color3.fromRGB(237, 234, 234)
				task.wait(tonumber("0.0"..math.random(1, 9)))
			end
		end
	end)

	task.wait(Times)
	Doin = false
	for _, V in Lights do
		V.SpotLight.Enabled = true
		V.PointLight.Enabled = true
		V.Color = Color3.fromRGB(237, 234, 234)
	end

end

You’re missing an S, it’s GetDescendants

1 Like