This is the script that has the errors I do have other scripts where i show bellow
local self = {}
function self:StartEnemy(source,enemy)--Source is a array of out nodes that have been collected by central script local stats = require(game.ReplicatedStorage.Moldules.Types.EnemyStats)--returns what with the moldrural script orgional
stats = stats[enemy]
local obj = game.ReplicatedStorage.Assets.Enemys[enemy]:Clone() -- 0bj = object
obj.CFrame = source["StartingPoint"].CFrame
obj.Parent = workspace
for i=1,#source,1 do
local scf = obj.CFrame
for j = 0,1,stats.Speed*0.002 do
obj.CFrame = scf.lerp(source[i].CFrame + Vector3.new(0,obj.Position.Y - source[i].Position.Y,0),j)
wait(0.01)
end
end
end
return self
this the stats
local self = { Regular = { Speed = 10, Health = 10, Strengh = 1, } }
return self
this is the last script
local enemyai = require(game.ServerScriptService.Moldules.Classes.Enemy.EnemyAi)
local source = {}
for _,n in pairs(workspace.Cource.Paths:GetChildren()) do source[n.Tag.Value] = n end
source["StartingPoint"] = workspace.Cource.Other.StartPath
enemyai:StartEnemy(source, "Regular")
is there any way to fix it any help would be helpful

2 comments
sorry but most of it didn't go into script form sorry if it's hard to read
what line of code has the error?