Hi!
I was wondering how I could get the character right before he died in his position.
For example, this is a character moving.
How would I be able to make it so thats his death position,
In short I need to make it so when the character dies, he maintains his current position.
Any help is appreciated!
1 Like
Are you trying to save the position then return them back to that position when they respawn?
You can use the Died event on Humanoid, save it and then using CharacterAdded Event move the player to the same position, just a little bit above on the Y point.
For examle:
game.Players.candy666786.Character.Humanoid.Died:Connect(function()
game.Players.candy666786.Respawn.Value = game.Players.candy666786.Character.HumanoidRootPart.Position + Vector3.new(0,5,0) --Just in case the player has fully fallen on the ground, we do not want them stuck
end)
And then something like this:
game.Players.candy666786.CharacterAdded:Connect(function(char)
char.HumanoidRootPart.Position = game.Players.candy666786.Respawn.Value
end)
1 Like
I’m assuming you just want the character to freeze in place when they die? If that’s what you want, you could anchor all of the parts inside the character after Humanoid.Died
is fired.
local char = plr.Character
local hum = char:WaitForChild('Humanoid')
hum.Died:Connect(function()
for _, part in pairs(char:GetDescendants()) do
if not part:IsA('BasePart') then continue end
part.Anchored = true
end
end)
I’ve found my solution, I needed it frozen without them being anchored so I had to weld them to the HumanoidRootPart.