• 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!

Monsters doesnt die!

yanger

Banned User
Joined
Aug 28, 2009
Messages
740
Reaction score
7
Location
Stalowa Wola, Poland
On mine war ots, monster doesnt die.. they dont have hp, but still live..

I think its something with fragreward, cuz when i deleted it i think monsters worked good.


Code:
function onKill(cid, target, lastHit)
local reward = {item = 2152, count = 10}
if(isPlayer(cid) and isPlayer(target)) then
if getPlayerIp(cid) ~= getPlayerIp(target) then
doPlayerAddItem(cid, reward.item, reward.count)
else
doPlayerAddExperience(cid, -5000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
end
return true
end
end
 
Lua:
function onKill(cid, target, lastHit)
local reward = {item = 2152, count = 10}
if(isPlayer(cid) and isPlayer(target)) then
if getPlayerIp(cid) ~= getPlayerIp(target) then
doPlayerAddItem(cid, reward.item, reward.count)
else
doPlayerAddExperience(cid, -5000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
end
end
return true
end
 
Code:
[25/03/2010 14:49:27] [Error - CreatureScript Interface] 
[25/03/2010 14:49:27] data/creaturescripts/scripts/death.lua
[25/03/2010 14:49:27] Description: 
[25/03/2010 14:49:27] data/creaturescripts/scripts/death.lua:1: attempt to call global 'onDeath' (a nil value)
[25/03/2010 14:49:27] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/death.lua)
[25/03/2010 14:49:27] data/creaturescripts/scripts/startskills.lua:14: ')' expected (to close '(' at line 13) near 'setPlayerStorageValue'


and thats death.lua

Code:
onDeath(cid, corpse, deathList)
local reward = {
        item = 2674, --ITEM ID!
        count = 1 -- How many?
}
        if(isPlayer(cid) and isPlayer(target)) then
	if getPlayerIp(cid) ~= getPlayerIp(target) then
                doPlayerAddItem(cid, reward.item, reward.count)
	else


end
end
 
Code:
local reward = {
	item = 2674, --ITEM ID!
	count = 1 -- How many?
}
function onDeath(cid, corpse, deathList)
	for i = 1, #deathList do
		if isPlayer(deathList[i]) and getPlayerIp(cid) ~= getPlayerIp(deathList[i]) then
			doPlayerAddItem(deathList[i], reward.item, reward.count)
		end
	end
	return true
end
 
Back
Top