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

if getCreatureName(target) == "Zombie Boss" then THIS DOESNT WORK FOR MONSTERS?

Blood BlvD Ot

Member
Joined
Jun 12, 2010
Messages
243
Reaction score
7
if getCreatureName(target) == "Zombie Boss" then

I'm attempting to use this on an onKill script, but it seems to not work for monsters. Anyone have an alternative approach to this or a function that will work?
 
None, I tried creating a copy of the raid and making it go back n forwith between them incase it was because there was some kind of loop blockage goin on but nope :P xD
 
LUA:
function onKill(cid, target)
	if isMonster(target) then
		if getCreatureName(target):lower() == "monster" then
			-- do something
		end
	end
 
	return true
end

Or

LUA:
function onDeath(cid, corpse, deathList)
	if isMonster(cid) then
		if getCreatureName(cid):lower() == "monster" then
			-- do something
		end
	end
	
	return true
end
 
Last edited:
Code:
[17/02/2011 23:26:29] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/onKills.lua:41: function arguments expected near '=='
[17/02/2011 23:26:29] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/onKills.lua)
[17/02/2011 23:26:29] data/creaturescripts/scripts/onKills.lua:41: function arguments expected near '=='

Code:
	if inZombies == 1 then
                doCreatureSay(cid, "".. getZomb .."+5", TALKTYPE_ORANGE_1)
		setPlayerStorageValue(cid,zombieStorage,addZomb)
		if isMonster(target) then
			if getCreatureName(target):lower == "Zombie Boss I" then                 --THIS IS LINE 41 :D
				executeRaid("ZombieWaveTwo")
			elseif getCreatureName(target):lower == "Zombie Boss II" then
				executeRaid("ZombieWaveThree")
			elseif getCreatureName(target):lower == "Zombie Boss II" then
				doRemoveCreature(cid)
			end
		end
	end
return TRUE
end
 
LUA:
local config = {
	["Zombie 1"] = "Zombie Wave 2"
}

function onKill(cid, target)
	if isMonster(target) then
		for monster, raid in pairs(config) do
			if string.lower(getCreatureName(target) == monster) then
				doCreatureSay(cid, getZomb .. "+5", TALKTYPE_MONSTER)
				executeRaid(raid)
				break
			end
		end
	end
	
	return true
end

Without the full script, I can't do much. Hopefully you can figure out how to edit it properly.
 
if up didn't work try this ^^
LUA:
	if inZombies == 1 then
                doCreatureSay(cid, "".. getZomb .."+5", TALKTYPE_ORANGE_1)
		setPlayerStorageValue(cid,zombieStorage,addZomb)
		if isMonster(target) then
			if getCreatureName(target):lower() == "Zombie Boss I" then                 --THIS IS LINE 41 :D
				executeRaid("ZombieWaveTwo")
			elseif getCreatureName(target):lower() == "Zombie Boss II" then
				executeRaid("ZombieWaveThree")
			elseif getCreatureName(target):lower() == "Zombie Boss II" then
				doRemoveCreature(cid)
			end
		end
	end
return TRUE
end
 
could you explain to me where your config even comes into play here in this script?

my onKills.lua file xD
Code:
function onKill(cid, target, lastHit)
------------------------------------------------------------
local rankStorage = 30500
local getFrags = getPlayerStorageValue(cid,rankStorage)
local addFrag = ((getPlayerStorageValue(cid,10000))+1)
------------------------------------------------------------
local killStreaks = 10010
local getKSP = getPlayerStorageValue(cid,killStreaks)
local addKSP = ((getPlayerStorageValue(cid,10010))+1)
------------------------------------------------------------
local zombieStorage = 30550
local getZomb = getPlayerStorageValue(cid,zombieStorage)
local addZomb = ((getPlayerStorageValue(cid,30550))+5)
local zombieNames = {"Zombie","Zombie Boss","Undead Hound"}
local zombieDefenderStorage = 10240
local inZombies = getPlayerStorageValue(cid,zombieDefenderStorage)
------------------------------------------------------------
local inArena = getPlayerStorageValue(cid,10020)
local reward = 2152
local pos = getPlayerPosition(cid)

		if inArena == 10 then
			if(isPlayer(cid) and isPlayer(target)) then
				if getPlayerIp(cid) == getPlayerIp(target) then
					doPlayerAddExperience(cid,-100000)
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
				elseif getFrags <= 1000 then
					doPlayerAddItem(cid,reward,getKSP)
					setPlayerStorageValue(cid,rankStorage,addFrag)
					doCreatureSay(cid, getKSP, TALKTYPE_ORANGE_1)
				end
			else
			end
		elseif inZombies == 1 then
			doCreatureSay(cid, "".. getZomb .."+5", TALKTYPE_ORANGE_1)
			setPlayerStorageValue(cid,zombieStorage,addZomb)
			if isMonster(target) then
				if getCreatureName(target):lower() == "Zombie Boss I" then
					executeRaid("ZombieWaveTwo")
				elseif getCreatureName(target):lower() == "Zombie Boss II" then
					executeRaid("ZombieWaveThree")
				elseif getCreatureName(target):lower() == "Zombie Boss II" then
					doRemoveCreature(cid)
				end
			end
		end
return TRUE
end
OHM any halpzerz here??? xD
 
Last edited:
Back
Top