Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How can I fix my enemy respawning?

Asked by 9 years ago

Whenever I place my own enemies (Saved to Roblox) from my models in the toolbox into my world and I or someone kills them they respawn in the same exact place how can I change the place where they respawn? (This isn't with just one of my enemies but with all of them)

0
Ok, your NPC gets spawned (firstly) by using the InsertService, correct? If so, do you insert the NPC again every time it respawns? Or is there a script within it that handles that? (Post on my answer so that I will receive a notification.) Redbullusa 1580 — 9y
0
Show your respawn script, please. Redbullusa 1580 — 9y

1 answer

Log in to vote
0
Answered by
Redbullusa 1580 Moderation Voter
9 years ago

Set the PrimaryPart of your NPCs! This gives you the option to use the :MoveTo() and the :SetPrimaryPartCFrame methods.

To set your NPC's PrimaryPart...

  1. Open up the command bar.

  2. Input this (adjust it to your desire).

-- Server Script
YourNPC = workspace.YourNPC

YourNPC:MoveTo(Vector3.new(0, 0, 0))

If you have a part that you want your NPC to spawn to...

YourNPC = workspace.YourNPC
SpawnPoint = workspace.SpawnPoint

YourNPC:MoveTo(SpawnPoint.Position)
0
Would I write "YourNPC" Or my Npcs name? UltimateRoGuy 0 — 9y
0
I set the primary part but it still respawns NOT where I wanted it to and i set my torso place to the place in the script to spawn where my torso was but it doesnt listen >:( UltimateRoGuy 0 — 9y
0
I do accept your answer it helped me out a lot, But it wont let me actually accept it. UltimateRoGuy 0 — 9y
0
And I have a respawn script, But i came across a problem. When the Deer I have respawn sometimes they respawn in the other deer spawn locations. how would i fix that? & I appriciate your help. UltimateRoGuy 0 — 9y
Ad

Answer this question