Basically, I was wondering how I could make it so the player’s body does not despawn after they die, and instead lays there for around 5-10 minutes.
I want the player to respawn but their body should stay there.
Basically, I was wondering how I could make it so the player’s body does not despawn after they die, and instead lays there for around 5-10 minutes.
I want the player to respawn but their body should stay there.
Increase Players.RespawnTime
on Explorer or through a script
Edit: I just realized what you meant, you could detect when the humanoid dies then clone the player’s character and parent it to workspace and reload the character using player:LoadCharacter()
and destroy the cloned character after some time.
u would detect the player that died through the function Humanoid.Died
, then if you want the body to be seen by other players, you have to send a remote event to the server and send the player’s co-ordinates to the server i think. u use the debris service to delete the character’s model after a period of time.
it should be something like this:
client:
local remoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local player = game.Players.LocalPlayer
local c = player.Character or player.CharacterAdded:Wait()
local h = c:WaitForChild("Humanoid")
local HRP = c:FindFirstChild("HumanoidRootPart")
h.Died:Connect(function()
remoteEvent:FireServer(HRP.Position)
end)
server:
local DebrisService = game:GetService("Debris")
local remoteEvent = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local TenMinutes = 60 * 10
remoteEvent.OnServerEvent:Connect(function(player, HRP_Position)
local c = player.Character
local charClone = c:Clone()
charClone.Parent = workspace
charClone.Position = HRP_Position
DebrisService:AddItem(charClone, TenMinutes)
end)
i doubt this will work but thats what i would do
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.