I just want to clone a part into the player after they die, the problem is, the part disappears when the player respawns, any help?
01 | game.Players.PlayerAdded:Connect( function (player) |
02 | player.CharacterAdded:Connect( function (character) |
03 | local Children = character:GetChildren() |
04 | character:WaitForChild( "Humanoid" ).Died:Connect( function () |
05 | wait( 2 ) |
06 | local clone = game.ReplicatedStorage.Link |
07 | clone.Parent = character |
08 | wait( 0.1 ) |
09 | end ) |
10 | end ) |
11 | end ) |
Here's your answer:
01 | game:GetService( "Players" ).PlayerAdded:Connect( function (plr) |
02 | plr.CharacterAdded:Connect( function (chr) |
03 | chr:WaitForChild( "Humanoid" ).Died:Connect( function () |
04 | local Part = nil -- Replace nil with part directory, e.g. game.Workspace.Part |
05 | local PartClone = Part:Clone() |
06 |
07 | PartClone.Parent = chr |
08 | end ) |
09 | end ) |
10 | end ) |
Remember to always search Roblox Dev first, https://developer.roblox.com/en-us/api-reference/event/Humanoid/Died