#so why am i getting attempt to call a nil value

4 messages · Page 1 of 1 (latest)

gritty ruin
#

heres the error i get

#

01:40:35.456 ServerScriptService.Server:5: attempt to call a nil value - Server - Server:5

#

and my main script ```local Tycoon = {}
Tycoon.__index = Tycoon

function Tycoon.new(player)
local self = setmetatable({}, Tycoon)
self.Owner = player

return self

end

function Tycoon:Init()
self.Model = NewModel(template, CFrame.new(0, 1, 0))

self:AddComponents(self.Model.Part)

end

function Tycoon:AddComponents(instance)
for _, tag in ipairs(CollectionService:GetTags(instance)) do
local component = componentFolder:FindFirstChild(tag)
if component then
self:CreateComponent(instance, component)
end
end
end

function Tycoon:CreateComponent(instance, componentScript)
local compModule = require(componentScript)
local newComp = compModule.new(self, instance)
newComp:Init()
end

function Tycoon:Destroy()
self.Model:Destroy()
end

return Tycoon