ID:141526
 
This is the code where the problem happends:

                    if(M.Powerlevel<=10)//THIS IS THE CODE THAT IT POINTS TO
usr.Enemies_Killed += 1
usr << "You Defeated [M], You gain <B><U>[commas(num2text(round(M.Zeni),99999999))] Zeni</U></B> and <B><U>[commas(num2text(round(M.MaxExp),99999999))] Exp</B></U>"
usr.Exp += M.MaxExp
usr.Zeni += M.Zeni
usr.LevelUp()
del(M)
return

The runtime error says:

runtime error: Cannot read null.Powerlevel
proc name: Kick (/mob/verb/Kick)
source file: Combat.dm,154
usr: Guest-2520799949 (/mob/Player)
src: Guest-2520799949 (/mob/Player)
call stack:
Guest-2520799949 (/mob/Player): Kick(null)
Show what's before that line.
Your issue is exactly as described: M is null.

Without the code preceeding the error and the context its impossible to determine why.
In response to Alathon
I know it's null because when I kill the monster/NPC it will delete it and my attacking is set as a macro which people tend to press the button after the NPC/Monster is destroyed, which causes the runtime error.
In response to Andre-g1
I know the coding ain't the best but you can make comments on anything.

                if(M.Monster == 1)
M.Attacked = 1
var/dmg = usr.Strength
M.overlays = /obj/Punched
M.Powerlevel -= dmg
usr.overlays = /obj/Combat
M.dir = get_dir(M,usr)
F_damage(M, dmg, color = "#ff0000")
usr.icon_state = "punch1"
sleep(4)
usr.icon_state = ""
view(usr)<<'hit1.wav'
if(M.Powerlevel<=10) // This is where the problem occurs.
usr.Enemies_Killed += 1
usr << "You Defeated [M], You gain <B><U>[commas(num2text(round(M.Zeni),99999999))] Zeni</U></B> and <B><U>[commas(num2text(round(M.MaxExp),99999999))] Exp</B></U>"
usr.Exp += M.MaxExp
usr.Zeni += M.Zeni
usr.LevelUp()
del(M)
return
In response to Gizhy
Gizhy wrote:
I know it's null because when I kill the monster/NPC it will delete it

Well then what you need to do is double-check that M even exists and not delete M before you're done with it.
In response to Alathon
Can you help me out by showing some sort of example?
In response to Gizhy
Show us where M is actually defined, like is it a param (mob/M), or is it pure declaration 'var/mob/M = new'

Etc.
In response to Haywire
I already fixed the prob, but thanks for the reply.