game.Players.PlayerAdded:Connect(function(player) local plrname = player.Name local humanoid = game.Workspace:WaitForChild(plrname) local hum = humanoid:WaitForChild("Humanoid") local function onCharacterAdded(character) end player.CharacterAdded:Connect(onCharacterAdded) if player.Character then -- my code -- end end)
I tried using this but it only works once
Do this:
player.Character.Humanoid.Died:Connect(function) --Blahblah blah end)
You can search in the wiki for that for more info.