What do you want to achieve?
I’m trying to loop thru a module script and call all of its functions.
What is the issue?
I get a error that doesn’t make sense.
" ServerStorage.Mods.SpecCurseMods.SpecMods:11: attempt to call a nil value - Server - SpecMods:11"
What solutions have you tried so far?
I’ve tried looking for similar problems, but found no results.
local module = {
EveryCurse = function(plr)
local mod = require(script.Parent.Parent.CurseFunc)
local modInfo = require(script.Parent.Parent.Curses)
local folder = plr:WaitForChild("Curses")
for i,v in pairs(mod) do
if modInfo[i][1] == "EveryCurse" then continue end
mod[1](plr) -- error here
print(i)
end
end,
}
return module
Ik that the [1] should be the i but for some reason it only fires 2 functions when I do that so I’m trying to troubleshoot my script
local module = {
Frozen = function(plr)
specMods.TagAdd(plr, "Frozen")
local event = game:GetService("ReplicatedStorage"):WaitForChild("Events").ChangeColor
local char = plr.Character or plr.CharacterAdded:Wait()
plr.CharacterAppearanceLoaded:Connect(function()
for i, v in pairs(char:GetChildren()) do
if v:IsA("MeshPart") then
v.Transparency = .15
v.Anchored = true
v.BrickColor = BrickColor.new("Cyan")
end
end
if char.Humanoid:FindFirstChild("Animator") then char.Humanoid.Animator:Destroy() end
if char:FindFirstChild("Animate") then char.Animate:Destroy() end
event:FireAllClients( game.Workspace:WaitForChild(plr.Name) )
end)
end
}
return module