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

Creature not found - lua script

straher

???
Joined
Mar 23, 2010
Messages
255
Reaction score
3
Lua:
function onKill(cid, target, lastHit)
	if cid ~= target and isPlayer(target) then
doCreatureSetStorage(6001, getPlayerStorageValue(6001)+1)
		end
	end
	if(getPlayerStorageValue(cid, 6776) == 1) and getCreatureStorage(cid, 6001) == -1 then
		setPlayerStorageValue(cid, 6001, 1)
		doCreatureSetSkullType(cid, 1) 

	elseif(getPlayerStorageValue(cid, 6776) == 10) and getCreatureStorage(cid, 6002) == -1 then
		setPlayerStorageValue(cid, 6002, 1)
		doCreatureSetSkullType(cid, 2) -- 3 is red

	elseif(getPlayerStorageValue(cid, 6776) == 50) and getCreatureStorage(cid, 6003) == -1 then
		setPlayerStorageValue(cid, 6003, 1)
		doCreatureSetSkullType(cid, 3) -- 5 is black
 
	elseif(getPlayerStorageValue(cid, 6776) == 100) and getCreatureStorage(cid, 6005) == -1 then
		setPlayerStorageValue(cid, 6005, 1)
doCreatureSetSkullType(cid, 4)

	elseif(getPlayerStorageValue(cid, 6776) == 150) and getCreatureStorage(cid, 6006) == -1 then
		setPlayerStorageValue(cid, 6006, 1)
	doCreatureSetSkullType(cid, 5)

	return true
end

I guess it's something wrong with 2 lines in the begining but I have got no idea how to fix it
 
Lua:
doCreatureSetStorage(6001, getPlayerStorageValue(6001)+1)
to
Lua:
doCreatureSetStorage(cid, 6001, getPlayerStorageValue(6001)+1)
 
Tested, it does not work. It's the same error and it must be connected with repeating part as it shows up 5 times.
 
Last edited:
Lua:
function onKill(cid, target, lastHit)
	if cid ~= target and isPlayer(target) then
doCreatureSetStorage(cid, 6001, getPlayerStorageValue(cid, 6001)+1)
		end
	end
	if(getPlayerStorageValue(cid, 6776) == 1) and getCreatureStorage(cid, 6001) == -1 then
		setPlayerStorageValue(cid, 6001, 1)
		doCreatureSetSkullType(cid, 1) 

	elseif(getPlayerStorageValue(cid, 6776) == 10) and getCreatureStorage(cid, 6002) == -1 then
		setPlayerStorageValue(cid, 6002, 1)
		doCreatureSetSkullType(cid, 2)

	elseif(getPlayerStorageValue(cid, 6776) == 50) and getCreatureStorage(cid, 6003) == -1 then
		setPlayerStorageValue(cid, 6003, 1)
		doCreatureSetSkullType(cid, 3)
 
	elseif(getPlayerStorageValue(cid, 6776) == 100) and getCreatureStorage(cid, 6005) == -1 then
		setPlayerStorageValue(cid, 6005, 1)
doCreatureSetSkullType(cid, 4)

	elseif(getPlayerStorageValue(cid, 6776) == 150) and getCreatureStorage(cid, 6006) == -1 then
		setPlayerStorageValue(cid, 6006, 1)
	doCreatureSetSkullType(cid, 5)

	return true
end

and still:

Code:
[12/08/2011 09:18:54] [Error - CreatureScript Interface] 
[12/08/2011 09:18:54] data/creaturescripts/scripts/skulls.lua
[12/08/2011 09:18:54] Description: 
[12/08/2011 09:18:54] (luaGetCreatureStorage) Creature not found
x5
 
well still doesn't work but it doesn't print any errors

Lua:
function onKill(cid, target, lastHit)
	if cid ~= target and isPlayer(target) then
doCreatureSetStorage(cid, 6776, getPlayerStorageValue(cid, 6776)+1)
	end
	if(getPlayerStorageValue(cid, 6776) == 1) and getCreatureStorage(cid, 6001) == -1 then
		setPlayerStorageValue(cid, 6001, 1)
		doCreatureSetSkullType(cid, 1) 

	elseif(getPlayerStorageValue(cid, 6776) == 10) and getCreatureStorage(cid, 6002) == -1 then
		setPlayerStorageValue(cid, 6002, 1)
		doCreatureSetSkullType(cid, 2) -- 3 is red

	elseif(getPlayerStorageValue(cid, 6776) == 50) and getCreatureStorage(cid, 6003) == -1 then
		setPlayerStorageValue(cid, 6003, 1)
		doCreatureSetSkullType(cid, 3) -- 5 is black
 
	elseif(getPlayerStorageValue(cid, 6776) == 100) and getCreatureStorage(cid, 6005) == -1 then
		setPlayerStorageValue(cid, 6005, 1)
doCreatureSetSkullType(cid, 4)

	elseif(getPlayerStorageValue(cid, 6776) == 150) and getCreatureStorage(cid, 6006) == -1 then
		setPlayerStorageValue(cid, 6006, 1)
	doCreatureSetSkullType(cid, 5)
end
	return true
end
 
Last edited:
Back
Top