I've been wondering for along time and never really found out how to do this.
Im not asking for a script, just for a step in the right direction, thank you.
A simpler way of wfvj014's solution would be a loop.
My appologies, I incorrectly connected the "Died" event.
01 | game.Players.PlayerAdded:connect( function (plr) |
02 | local A = game.Workspace:WaitForChild(plr.Name):GetChildren() |
03 | game.Workspace:WaitForChild(plr.Name).Humanoid.Died:connect( function () |
04 | for i,v in pairs (A) do |
05 | if v:IsA( "BasePart" ) then |
06 | v.Anchored = true |
07 | end |
08 | end |
09 | end ) |
10 | end ) |
I'll provide a way of doing this.
Just anchor the player's parts on death
To do this, use a Died Event
. When A player dies, anchor their parts.
Here's an example,
01 | --in a regular script in ServerScriptService |
02 | game.Players.PlayerAdded:Connect( function (plr) |
03 | plr.Died:connect( function () |
04 | plr.Character:FindFirstChild( "LeftLeg" ).Anchored = true |
05 | plr.Character:FindFirstChild( "RightLeg" ).Anchored = true |
06 | plr.Character:FindFirstChild( "Torso" ).Anchored = true |
07 | plr.Character:FindFirstChild( "Head" ).Anchored = true |
08 | plr.Character:FindFirstChild( "LeftArm" ).Anchored = true |
09 | plr.Character:FindFirstChild( "RightArm" ).Anchored = true |
10 | end ) |
11 | end ) |
You could go through all of the parts and anchor them but I didn't feel like it.
There may be better solutions, this is just my solution.
Good Luck