len_ny
|
  |
| Joined: 25 Sep 2014 |
| Total Posts: 242 |
|
|
| 11 Dec 2016 07:33 PM |
sooooo i was thinkin on makin a script for a enemy type defense game and it seems the enemy doesnt like to go into the ending where i have its designated destination to the script works it has the enemy continuely spawning and stuff but the enemy doesnt go into the actual block i tell it to go to
Heres the Module Script: local self = {}
function self:StartEnemy(source, enemy) --Source is an array of our nodes that have been collected by central script. local stats = require(game.ReplicatedStorage.Modules.Types.EnemyStats) --Returns the Enemies Table stats = stats[enemy] local obj = game.ReplicatedStorage.Assets.Enemies[enemy]:Clone() --Obj = 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
Heres for Testing it out: local enemyai = require(game.ServerScriptService.Modules.Classes.Enemies.EnemyAI)
local source = {}
for _,n in pairs(workspace.Course.Paths:GetChildren()) do source[n.Tag.Value] = n end
source["StartingPoint"] = workspace.Course.Other.StartPath
while wait() do spawn(function() enemyai:StartEnemy(source, "Regular") end) wait(10) end
anything would help thanks
|
|
|
| Report Abuse |
|
Ryuzoji
|
  |
| Joined: 21 Dec 2015 |
| Total Posts: 937 |
|
|
| 11 Dec 2016 07:35 PM |
@OP rude
I was gonna help 'till I saw the title and I saw no error outputs at all.
|
|
|
| Report Abuse |
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 11 Dec 2016 07:37 PM |
Ryuzoji[2]
Post output. Of the top of my head it sounds like you might be trying to set the CFrame of Models (which don't have that property). |
|
|
| Report Abuse |
|
len_ny
|
  |
| Joined: 25 Sep 2014 |
| Total Posts: 242 |
|
|
| 12 Dec 2016 06:08 AM |
first there not models second theres no error it just stops mid way to the end so thats the best i can give you
|
|
|
| Report Abuse |
|