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: Moving a complete NPC model to another location

Previous Thread :: Next Thread 
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
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
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 03:41 PM
b
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 03:42 PM
b2
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 03:49 PM
b3, can't a guy get help? :(
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 03:53 PM
b4
Report Abuse
mightybaseplate is not online. mightybaseplate
Joined: 28 Aug 2010
Total Posts: 7660
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
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
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 is not online. 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 is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
22 Apr 2015 03:58 PM
model.Part.CFrame = CFrame*

lol


I script -~ chimmihc
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
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
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 04:09 PM
b5
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 04:11 PM
b6
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 04:13 PM
b777
Report Abuse
chimmihc is not online. 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
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 04:23 PM
ah.
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
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
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
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 is not online. 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
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 04:39 PM
@chi

There's no position. The model can't move itself!
Report Abuse
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 04:42 PM
b8...
Report Abuse
chimmihc is not online. 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
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 04:44 PM
@chi

If I can, where would I add .Position?

I tried everywhere.
Report Abuse
chimmihc is not online. 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
Negativize is not online. Negativize
Joined: 02 May 2011
Total Posts: 25068
22 Apr 2015 04:46 PM
@chi

I feel like I'm damn stupid. God bless you.
Report Abuse
xman262 is not online. 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
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