Death(mob/M)
if(src.Hp <= 0)
Hp = 0
if(!src.client)
if(istype(src,/monster/))
new/obj/bloodtraill(src.loc)
M.Xp += round((src.Xp))
M.TBXp += src.Xp
M.DK += src.DK
M.TK += 1
M.Rep += src.Rep
spawn del src
M << output("<font color=#347C2C> You've gained Xp for killing [src].","info")
M.Rep += 1
if(M.in_party == 1)
for(var/mob/P in usr.party)
for(P in oview(8))
var/fair_share = round(Xp/members)
P.Xp +=fair_share
P << output("<font color=#347C2C> You've gained [fair_share] Xp.","info")
M.Level_up()
M.UpDateB()
spawn del src
respawn(type, locate(sx,sy,sz))
if(src.Npc == 1)
spawn del src
M.Xp += round( (rand(src.Xp * 0.8, src.Xp * 1.2) ))
M.TBXp += src.Xp
M.DK += src.DK
M.TK += src.TK
M.Rep += src.Rep
M << output("<font color=#387C44> You've gained experience for killing [src].","info")
src.SaveC()
spawn del src
Problem description:
Party System will not give exp when some in the party kill a monster
Second, I can only imagine you want to increment M's party's experience, not usr's.
Chances are M might be your usr, but I would need to know more to determine that. You're also refering to a members variable that is never defined within the function, so I can only assume it is a member of src...
What I do know is your method of checking the distance their mob is from the party is completely wrong. for(P in oview(8)) is not checking if the value held by P is in oview(8). It's starting a loop and going through all of the mobs in oview(8). For every member of the party. What you want is "if(P in oview(8))". Even better, you should save this value (oview(8)) outside of the loop somewhere, so you don't have to keep generating the list every time.