• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

sql help

Joined
Jun 22, 2010
Messages
268
Solutions
1
Reaction score
5
Location
Usa, Utah
how can i make this only do the query for the play that kills the creature?
Lua:
local dano = damage
function onKill(cid, target, damage, flags)
     if isMonster(target) then    
     db.executeQuery("UPDATE `player_storage` SET `value` = `value` + ".. dano .." WHERE `key` = ".. 7854 .." WHERE `player_id` = ".. getPlayerGUID(cid) .."")
end    
return true
end
 
did you mean last hit?
and you should be using lua function instead of query :p:p
Lua:
function onKill(cid, target, damage, flags)
	if bit.band(flags, 1) == 1 and isMonster(target) then
		doCreatureSetStorage(cid, 7854, math.max(0, getCreatureStorage(cid, 7854)) + damage)
	end
	return true
end
 
Back
Top