Module function errors

local module = {}

function module.AddEffect(char,effect)
	local character = char
	local effects = character:WaitForChild("Effects")
	local search = effects:GetDescendants()
	for i,v in pairs(search) do
		if v:IsA("BoolValue") and v.Name == effect then
			v.Value = true
		end
	end
end

function module.RemoveEffect(char,effect)
	local character = char
	local effects = character:WaitForChild("Effects")
	local search = effects:GetDescendants()
	for i,v in pairs(search) do
		if v:IsA("BoolValue") and v.Name == effect then
			v.Value = false
		end
	end
end

function module.GetStatus(char, effect)
	local character = char
	local effects = character:WaitForChild("Effects")
	local search = effects:GetDescendants()
	for i,v in pairs(search) do
		if v:IsA("BoolValue") and v.Name == effect then
			return v.Value
		end
	end
end

function module.ClearAllEffects(char)
	local effects = char:WaitForChild("Effects")
	for i,v in pairs(effects:GetDescendants()) do
		if v:IsA("BoolValue") then
			v.Value = false
		end
	end
end

return module

This script keeps returning a ReplicatedStorage.EffectManager:8: attempt to index nil with ‘WaitForChild’ error, which doesn’t seem to be doing anything but is incredibly annoying. Can someone tell me why?

does the character exist, and does effects exist

Yes. Yes they do.

Character is literally defined in the function params.

No,u are wrong.those are the send parameters

If u want to prove to me that they exsists,

Print(char) and print(effects)

And show me that effects and i think characater == nil

its not in serverstorage its in the character itself…

And yes, they did print.
image

what script do you use the module script?