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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 18 Dec 2014 02:48 PM |
| OW use enemy.Torso.CFrame = ... |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|