So basically the code simply won’t print the “Player Died” when the player dies. can’t for the life of me figure out why.
i = 0
game.Players.PlayerAdded:Connect(function(plr)
plr:LoadCharacter()
plr.CharacterAdded:Connect(function(char)
print("Character Loaded")
char:WaitForChild("Humanoid").Died:Connect(function()
print("Player Died")
i = 1
local rope = Instance.new("RopeConstraint", game.Workspace.RopeTarget)
local a0 = Instance.new("Attachment", game.Workspace.RopeTarget)
local a1 = Instance.new("Attachment", char.HumanoidRootPart)
rope.Attachment1 = a1
rope.Attachment0 = a0
a0.CFrame = game.Workspace.RopeTarget.CFrame
a1.CFrame = char.HumanoidRootPart.CFrame
rope.WinchEnabled = true
rope.WinchTarget = .5
while wait() and i == 1 do
if rope.Length == rope.WinchTarget then
i = 0
plr:LoadCharacter()
end
end
end)
end)
end)