Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = owner
- local Char = Player.Character
- local tweenService = game:GetService("TweenService")
- script.Parent = Player
- Char.Archivable = true
- local Clone = Char:Clone()
- Char.Archivable = false
- Clone.Parent = nil
- --Char:WaitForChild("Humanoid").Died:Connect(function()
- -- Char.Humanoid:Destroy()
- --end)
- local LoopEvent = Instance.new("RemoteEvent")
- LoopEvent.Name = "LoopEvent"
- LoopEvent.Parent = NLS([==[
- Player = owner
- local mouse = Player:GetMouse()
- local Char = owner.Character
- local Refit = false
- local CanDo = true
- local Follower = Instance.new("Part", workspace)
- Follower.Size = Vector3.new(2,2,2)
- Follower.CanCollide = false
- Follower.Transparency = 1
- local Health = false
- local LoopEvent = script.LoopEvent
- game:GetService("RunService").RenderStepped:Connect(function()
- workspace.CurrentCamera.CameraSubject = owner.Character
- if owner.Character:FindFirstChild("Torso") then
- Follower.CFrame = owner.Character.Torso.CFrame
- RespawnPos = Follower.CFrame
- else
- Follower.CFrame = Follower.CFrame
- end
- if owner.Character:FindFirstChild("Humanoid") then
- if owner.Character.Humanoid.Health <= 0 then
- owner.Character.Humanoid:Destroy()
- end
- end
- if CanDo then
- AncestryFun()
- end
- end)
- local LostLimb
- function AncestryFun()
- CanDo = false
- Refit = false
- if LostLimb ~= nil then
- repeat wait() until owner.Character:FindFirstChild(LostLimb)
- end
- for i,v in pairs(owner.Character:GetChildren()) do
- v.AncestryChanged:Connect(function(_, parent)
- if _.Name ~= owner.Character.Name then
- if not parent then
- LostLimb = _.Name
- if not Refit then
- Refit = true
- LoopEvent:FireServer(Refit, RespawnPos)
- CanDo = true
- end
- end
- end
- end)
- end
- end
- ]==],owner.PlayerGui)
- LoopEvent.OnServerEvent:Connect(function(Plr, Refit, RespawnPos)
- Update(Refit, RespawnPos)
- end)
- function Update(Refit, RespawnPos)
- if Refit == true then
- if workspace:FindFirstChild(owner.Character) ~= nil then
- PlayerReset()
- else
- PlayerReset(RespawnPos)
- end
- end
- end
- function PlayerReset(Pos)
- Char = Clone:Clone()
- Player.Character = Char
- Char.Parent = workspace
- Char.Torso.CFrame = Pos
- Char.Animate.Disabled = true
- wait()
- Char.Animate.Disabled = false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement