local U=script local A=U.Parent local O=Game:GetService("\068\101\098\114\105\115")repeat Wait(0)until script and(script.Parent and script.Parent.ClassName=="\077\111\100\101\108")local p for U,A in pairs(A:GetChildren())do if A and(A.ClassName=="\072\117\109\097\110\111\105\100"and A.Health>.001)then p=A end end local C=A:Clone()coroutine.resume(coroutine.create(function()if A and(p and(p:FindFirstChild("\083\116\097\116\117\115")and not(p: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=p:FindFirstChild("\083\116\097\116\117\115")SpawnModel.Name="\065\118\097\108\105\098\108\101\083\112\097\119\110\115"else SpawnModel=(p: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(U)local A=U:GetChildren()for U=1,#A,1 do if A[U].className=="\083\112\097\119\110\076\111\099\097\116\105\111\110"then local O=Instance.new("\086\101\099\116\111\114\051\086\097\108\117\101",SpawnModel)O.Value=A[U].Position O.Name=A[U].Duration end FindSpawn(A[U])end end FindSpawn(Game.Workspace)local U=SpawnModel:GetChildren()if#U>0 then local p=U[math.random(1,#U)]local C=Instance.new("\070\111\114\099\101\070\105\101\108\100")C.Parent=A C.Name="\083\112\097\119\110\070\111\114\099\101\070\105\101\108\100"O:AddItem(C,p.Name)A:MoveTo(p.Value+Vector3.new(0,3.5,0))else if A:FindFirstChild("\083\112\097\119\110\070\111\114\099\101\070\105\101\108\100")then(A:FindFirstChild("\083\112\097\119\110\070\111\114\099\101\070\105\101\108\100")):Destroy()end A:MoveTo(Vector3.new(0,115,0))end end))function Respawn()Wait(5)C.Parent=A.Parent C:MakeJoints();(C:FindFirstChild("\072\101\097\100")):MakeJoints();(C:FindFirstChild("\084\111\114\115\111")):MakeJoints()A:remove()end p.Died:connect(Respawn)
--
local AdvancedRespawnScript=script;
local Bob=AdvancedRespawnScript.Parent;
local GameDerbis=Game:GetService("Debris");
repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
local BobHumanoid;
for _,Child in pairs(Bob:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health>0.001 then
BobHumanoid=Child;
end;
end;
local Respawndant=Bob:Clone();
coroutine.resume(coroutine.create(function()
if Bob and BobHumanoid and BobHumanoid:FindFirstChild("Status")and not BobHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
SpawnModel=Instance.new("Model");
SpawnModel.Parent=BobHumanoid:FindFirstChild("Status");
SpawnModel.Name="AvalibleSpawns";
else
SpawnModel=BobHumanoid: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.Workspace);
local SpawnChilden=SpawnModel:GetChildren();
if#SpawnChilden>0 then
local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
local RespawningForceField=Instance.new("ForceField");
RespawningForceField.Parent=Bob;
RespawningForceField.Name="SpawnForceField";
GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
Bob:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
else
if Bob:FindFirstChild("SpawnForceField")then
Bob:FindFirstChild("SpawnForceField"):Destroy();
end;
Bob:MoveTo(Vector3.new(0,115,0));
end;
end));
function Respawn()
Wait(5);
Respawndant.Parent=Bob.Parent;
Respawndant:MakeJoints();
Respawndant:FindFirstChild("Head"):MakeJoints();
Respawndant:FindFirstChild("Torso"):MakeJoints();
Bob:remove();
end;
BobHumanoid.Died:connect(Respawn);