Attempt to index number with 'Name'

for i, v in pairs(script.Parent.Flame:GetDescendants()) do
	if i.Name=="Beam" then
		i.Enabled=true
	end
end

this script failed to activate beams, why ?

script.Parent.Flame:GetDescendants() returns an array so using a for loop on it would default the descendant to be the first value (v) and the index of the item to be the second value (*).

for i, v in pairs(script.Parent.Flame:GetDescendants()) do
	if v.Name=="Beam" then
		v.Enabled=true
	end
end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.