import es
import random

import wcs
from wcs import wcs

itemName = 'Scroll of Respawning'

wcs.Item(itemName).registerItem('special', 5000, "This scroll has a magical inscription to bring you back to life after you die", True)    
        
def player_death(ev):
    if wcs.Command(ev['userid']).GetItemCount(itemName):
        wcs.Command(ev['userid']).Spawn()
        wcs.Command(ev['userid']).RemoveItem(itemName)
