|
| 22 Apr 2015 03:39 PM |
This is a problem for me. I have ~20 squares, each which will be the position for a wave of NPC. The game selects a random square to spawn an NPC on. The NPCs move straight; their objective is a castle in front of them. My only problem: I don't want to make a NPC Lighting model above each node. That's time consuming.
How do I move the whole NPC model to a set point without killing it? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 Apr 2015 03:49 PM |
| b3, can't a guy get help? :( |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Apr 2015 03:55 PM |
I think your talking about moving a model, but it's an npc so It dies. I don't know how to fix that,
Correct me if I'm wrong |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2015 03:56 PM |
'I think your talking about moving a model, but it's an npc so It dies. I don't know how to fix that,
Correct me if I'm wrong.'
Hit the nail. Problem is, this is crucial, and the game completely fails without the NPCs. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 22 Apr 2015 03:57 PM |
model:MoveTo(position) model.Parent.CFrame = CFrame
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 22 Apr 2015 03:58 PM |
model.Part.CFrame = CFrame*
lol
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2015 04:07 PM |
@chi
local Node = game.Workspace.AINodes:GetChildren().Position
while true do wait(1) local NPC = game.Lighting.NPC:Clone() NPC.Parent = game.Workspace NPC:MoveTo(Node) NPC.Part.CFrame = CFrame end
Here's the script. When I try to run it, I get an error. "Argument 1 missing or nil." Line 7. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 22 Apr 2015 04:13 PM |
:GetChildren() returns a table, tables do not have positions.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Apr 2015 04:30 PM |
Now it just spawns them in one position, and not one of the random ones. :(
local Node = game.Workspace.AINodes:FindFirstChild('AISpawn')
while true do wait(1) local NPC = game.Lighting.NPC:Clone() NPC.Parent = game.Workspace NPC:MoveTo(Node) end |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2015 04:31 PM |
Forgot a Position. That's not the problem. :)
local Node = game.Workspace.AINodes:FindFirstChild('AISpawn').Position
while true do wait(1) local NPC = game.Lighting.NPC:Clone() NPC.Parent = game.Workspace NPC:MoveTo(Node) end |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 22 Apr 2015 04:31 PM |
local Nodes = game.Workspace.AINodes:GetChildren()
while true do wait(1) local Node = Nodes[math.random(#Nodes)] local NPC = game.Lighting.NPC:Clone() NPC.Parent = game.Workspace NPC:MoveTo(Node) end
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2015 04:39 PM |
@chi
There's no position. The model can't move itself! |
|
|
| Report Abuse |
|
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 22 Apr 2015 04:43 PM |
You can't add .Position to it?
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2015 04:44 PM |
@chi
If I can, where would I add .Position?
I tried everywhere. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 22 Apr 2015 04:45 PM |
local Nodes = game.Workspace.AINodes:GetChildren()
while true do wait(1) local Node = Nodes[math.random(#Nodes)].Position --< DING DING DING local NPC = game.Lighting.NPC:Clone() NPC.Parent = game.Workspace NPC:MoveTo(Node) end
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2015 04:46 PM |
@chi
I feel like I'm damn stupid. God bless you. |
|
|
| Report Abuse |
|
|
xman262
|
  |
| Joined: 24 Aug 2010 |
| Total Posts: 19094 |
|
|
| 22 Apr 2015 04:55 PM |
| omg how do you guys remember how to type this stuff??!?!?!?! |
|
|
| Report Abuse |
|
|