Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- Players.PlayerAdded:Connect(function(Player)
- local DeathCFrame = Instance.new("CFrameValue")
- DeathCFrame.Value = CFrame.new()
- DeathCFrame.Name = "DeathCFrame"
- DeathCFrame.Parent = Player
- Player.CharacterAdded:Connect(function(Character)
- if Player.DeathCFrame.Value ~= CFrame.new() then
- repeat task.wait() until Character:WaitForChild("HumanoidRootPart")
- Character.HumanoidRootPart.CFrame = Player.DeathCFrame.Value
- Player.DeathCFrame.Value = CFrame.new()
- end
- local Humanoid = Character.Humanoid
- Humanoid.BreakJointsOnDeath = false
- Humanoid.Died:Connect(function()
- Player.DeathCFrame.Value = Character.HumanoidRootPart.CFrame
- for _, v in pairs(Character:GetDescendants()) do
- if v:IsA("Motor6D") then
- local Attachment0, Attachment1 = Instance.new("Attachment"), Instance.new("Attachment")
- Attachment0.CFrame = v.C0
- Attachment1.CFrame = v.C1
- Attachment0.Parent = v.Part0
- Attachment1.Parent = v.Part1
- local BSC = Instance.new("BallSocketConstraint")
- BSC.Attachment0 = Attachment0
- BSC.Attachment1 = Attachment1
- BSC.Parent = v.Parent
- v:Destroy()
- end
- end
- local PP = Instance.new("ProximityPrompt")
- PP.Parent = Character.HumanoidRootPart
- PP.ObjectText = Player.Name
- PP.ActionText = "Revive"
- PP.HoldDuration = 5
- PP.RequiresLineOfSight = false
- PP.Enabled = false
- task.wait(.25)
- PP.Enabled = true
- ReplicatedStorage.Handler:FireClient(Player, "HidePrompt", PP)
- PP.Triggered:Connect(function(TriggPlayer)
- if TriggPlayer.Character.Humanoid.Health >= 1 then
- Player:LoadCharacter()
- PP:Destroy()
- end
- end)
- end)
- end)
- Player:LoadCharacter()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement