RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 02 Feb 2017 06:42 PM |
ERROR:
19:41:52.240 - ReplicatedStorage.Storage.Modules.EnemyAI:17: attempt to index field '?' (a nil value)
ModuleScript:
local self = {}
function self:CreateEnemy(source, enemy) local multiplier = 0.002 local stats = require(game.ReplicatedStorage.Storage.Modules.EnemyStats) stats = stats[enemy] local enemyObject = game.ReplicatedStorage.Storage.Enemies[enemy]:Clone() enemyObject.CFrame = source["Start"].CFrame enemyObject.Parent = workspace for i = 1, #source, 1 do local scf = enemyObject.CFrame for i = 0, 1, stats.Speed * multiplier do enemyObject.CFrame = scf:lerp(source[i].CFrame + Vector3.new(0, enemyObject.Position.Y - source[i].Position.Y, 0), i) wait() end end end
return self
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 02 Feb 2017 06:43 PM |
Which line is 17 my dude Also if you haven't the slightest idea I recommend not using free modeled code
|
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 02 Feb 2017 06:44 PM |
@soybeen
It isn't free modeled, I'm watching a tutorial. I've written this myself, it's really similar to the tutorial.
Line:
enemyObject.CFrame = scf:lerp(source[i].CFrame + Vector3.new(0, enemyObject.Position.Y - source[i].Position.Y, 0), i)
|
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 02 Feb 2017 06:45 PM |
Nevermind, it works now.. Weird!
|
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
| |
|