local N=false local j=script repeat Wait(0)until script and(script.Parent and script.Parent.ClassName=="\077\111\100\101\108")local C=j.Parent if j and(C and C:FindFirstChild("\084\104\117\109\098\110\097\105\108"))then(C:FindFirstChild("\084\104\117\109\098\110\097\105\108")):Destroy()end local f=Game:GetService("\068\101\098\114\105\115")local o for N,j in pairs(C:GetChildren())do if j and(j.ClassName=="\072\117\109\097\110\111\105\100"and j.Health~=0)then o=j end end local l=C:Clone()if N then coroutine.resume(coroutine.create(function()if C and(o and(o:FindFirstChild("\083\116\097\116\117\115")and not(o:FindFirstChild("\083\116\097\116\117\115")):FindFirstChild("\065\118\097\108\105\098\108\101\083\112\097\119\110\115")))then SpawnModel=Instance.new("\077\111\100\101\108")SpawnModel.Parent=o.Status SpawnModel.Name="\065\118\097\108\105\098\108\101\083\112\097\119\110\115"else SpawnModel=(o:FindFirstChild("\083\116\097\116\117\115")):FindFirstChild("\065\118\097\108\105\098\108\101\083\112\097\119\110\115")end function FindSpawn(N)local j=N:GetChildren()for N=1,#j,1 do if j[N].className=="\083\112\097\119\110\076\111\099\097\116\105\111\110"then local C=Instance.new("\086\101\099\116\111\114\051\086\097\108\117\101",SpawnModel)C.Value=j[N].Position C.Name=j[N].Duration end FindSpawn(j[N])end end FindSpawn(Game:GetService("\087\111\114\107\115\112\097\099\101"))local N=SpawnModel:GetChildren()if#N>0 then local j=N[math.random(1,#N)]local o=Instance.new("\070\111\114\099\101\070\105\101\108\100")o.Parent=C o.Name="\083\112\097\119\110\070\111\114\099\101\070\105\101\108\100"f:AddItem(o,j.Name)C:MoveTo(j.Value+Vector3.new(0,3.5,0))else if C:FindFirstChild("\083\112\097\119\110\070\111\114\099\101\070\105\101\108\100")then(C:FindFirstChild("\083\112\097\119\110\070\111\114\099\101\070\105\101\108\100")):Destroy()end C:MoveTo(Vector3.new(0,115,0))end end))end function Respawn()Wait(5)l.Parent=C.Parent l:makeJoints();(l:FindFirstChild("\072\101\097\100")):MakeJoints();(l:FindFirstChild("\084\111\114\115\111")):MakeJoints()C:remove()end if j and(C and o)then o.Died:connect(Respawn)end
--
local PlayerSpawning=false; --[[ Change this to true if you want the NPC to spawn like a player, and change this to false if you want the NPC to spawn at it's current position. ]]--
local AdvancedRespawnScript=script;
repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
local JaneTheKiller=AdvancedRespawnScript.Parent;
if AdvancedRespawnScript and JaneTheKiller and JaneTheKiller:FindFirstChild("Thumbnail")then
JaneTheKiller:FindFirstChild("Thumbnail"):Destroy();
end;
local GameDerbis=Game:GetService("Debris");
local JaneTheKillerHumanoid;
for _,Child in pairs(JaneTheKiller:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
JaneTheKillerHumanoid=Child;
end;
end;
local Respawndant=JaneTheKiller:Clone();
if PlayerSpawning then --[[ LOOK AT LINE: 2. ]]--
coroutine.resume(coroutine.create(function()
if JaneTheKiller and JaneTheKillerHumanoid and JaneTheKillerHumanoid:FindFirstChild("Status")and not JaneTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
SpawnModel=Instance.new("Model");
SpawnModel.Parent=JaneTheKillerHumanoid.Status;
SpawnModel.Name="AvalibleSpawns";
else
SpawnModel=JaneTheKillerHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
end;
function FindSpawn(SearchValue)
local PartsArchivable=SearchValue:GetChildren();
for AreaSearch=1,#PartsArchivable do
if PartsArchivable[AreaSearch].className=="SpawnLocation"then
local PositionValue=Instance.new("Vector3Value",SpawnModel);
PositionValue.Value=PartsArchivable[AreaSearch].Position;
PositionValue.Name=PartsArchivable[AreaSearch].Duration;
end;
FindSpawn(PartsArchivable[AreaSearch]);
end;
end;
FindSpawn(Game:GetService("Workspace"));
local SpawnChilden=SpawnModel:GetChildren();
if#SpawnChilden>0 then
local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
local RespawningForceField=Instance.new("ForceField");
RespawningForceField.Parent=JaneTheKiller;
RespawningForceField.Name="SpawnForceField";
GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
JaneTheKiller:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
else
if JaneTheKiller:FindFirstChild("SpawnForceField")then
JaneTheKiller:FindFirstChild("SpawnForceField"):Destroy();
end;
JaneTheKiller:MoveTo(Vector3.new(0,115,0));
end;
end));
end;
function Respawn()
Wait(5);
Respawndant.Parent=JaneTheKiller.Parent;
Respawndant:makeJoints();
Respawndant:FindFirstChild("Head"):MakeJoints();
Respawndant:FindFirstChild("Torso"):MakeJoints();
JaneTheKiller:remove();
end;
if AdvancedRespawnScript and JaneTheKiller and JaneTheKillerHumanoid then
JaneTheKillerHumanoid.Died:connect(Respawn);
end;