generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why is this happening?

Previous Thread :: Next Thread 
RobuxLife is not online. 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 is not online. 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 is not online. 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 is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
02 Feb 2017 06:45 PM
Nevermind, it works now.. Weird!


Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
02 Feb 2017 06:51 PM
nvm its broken


Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
02 Feb 2017 07:02 PM
bump


Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
02 Feb 2017 07:09 PM
pls


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image