Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I fix my enemy respawning?

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)

2 comments

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.)

0

Show your respawn script, please.

1 answer

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)

4 comments

0

Would I write "YourNPC" Or my Npcs name?

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 >:(

0

I do accept your answer it helped me out a lot, But it wont let me actually accept it.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.