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: Spawning Humanoid

Previous Thread :: Next Thread 
daireb is not online. daireb
Joined: 16 Nov 2012
Total Posts: 726
18 Dec 2014 02:15 PM
I have an issue in my game, where I need to spawn humanoids in a dungeon, the problem being, for some reason when I clone the example model, and CFrame it to the right position, all the other humanoid I'd cloned before that go there too? Any help appreciated. If you need more info than that I can put some scripts up.
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
18 Dec 2014 02:16 PM
Most likely you have various things named the same. Try classifying them with something to distinguish between them such as: Zombie1,Zombie2,etc
Report Abuse
daireb is not online. daireb
Joined: 16 Nov 2012
Total Posts: 726
18 Dec 2014 02:18 PM
I tried that, but it didn't work, and I'm referencing them with a variable anyway.
i.e.

local enemy = game.Workspace.Enemy:Clone()
enemy.CFrame = CFrame.new... etc.

So it shouldn't make a difference, I will try again tho.
Report Abuse
daireb is not online. daireb
Joined: 16 Nov 2012
Total Posts: 726
18 Dec 2014 02:20 PM
PS, when I try the same code but cloning just a part, or a few parts, it works perfectly, but whenever I try do it to a humanoid npc, it breaks. Seem suspicious?
Report Abuse
daireb is not online. daireb
Joined: 16 Nov 2012
Total Posts: 726
18 Dec 2014 02:28 PM
Not as urgent now, I just cloned regular parts and then cloned the enemy to their positions. I'm still curious as to what the problem was though, any ideas?
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
18 Dec 2014 02:47 PM
for i=1, 10 do
local enemy = ...
enemy.Position = ...
end

-- for only 1 mob, for more do

local names = ["zomb", ...]
local pos = -- define the pos

for i=1, #names do
local enemy = game.ReplicatedStorage:FindFirstChild(names[i]):Clone()
enemy.Position = pos + Vector3.new(math.random(-10,10),0,math.random(-10,10) -- will spawn them around pos
end
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
18 Dec 2014 02:48 PM
OW use enemy.Torso.CFrame = ...
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
19 Dec 2014 04:59 AM
Use :MakeJoints()
Report Abuse
daireb is not online. daireb
Joined: 16 Nov 2012
Total Posts: 726
19 Dec 2014 07:02 AM
@Hibobb

That is incorrect syntax, should be :makeJoints(), and that doesn't help, the enemies have all their limbs, trust me ;)

@Parkiet13

That's pretty much what my script looked like before, but it didn't work.

I even tried cloning scripts and each script make an enemy, but that had the same problem.
I have a feeling it might be something to do with roblox, not my script, although I am notorious for not noticing my own flaws. ;)
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
19 Dec 2014 08:20 AM
daireb
It can be MakeJoints()
and makeJoints()


~Master bug finder twitch.tv/ROBLOX/c/4691695 14:08~
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
19 Dec 2014 08:20 AM
and its ur scripts fault, not ROBLOX'


~Master bug finder twitch.tv/ROBLOX/c/4691695 14:08~
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