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

Script help

Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if (getCreatureSkullType(cid)  >= 4) then
	if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 11387) then
		doCreatureSetDropLoot(cid, false)      
	end
	return true
	end
	return true
	end

This script works perfectly, even if you have a red skull you won't lose anything wearing ID 11387.

I tried to modify it, so it works with all skulls (even if u don't have skull, u wont lose anything)

I changed
Lua:
if (getCreatureSkullType(cid)  >= 4)
to
Lua:
if (getCreatureSkullType(cid)  >= 0)
it didn't work

then I removed the entire line;
Lua:
if (getCreatureSkullType(cid)  >= 4)

and it still didn't work... how do I fix it so even if u have no skull, red skull or black skull u won't lose anything
 
Code:
getCreatureSkullType(cid)
				Info
					This function checks creature current skull.

				Returns
					Creature skull.
					For example:
						SKULL_NONE (0) - means, no SKULL_GREEN
						SKULL_YELLOW (1)
						SKULL_GREEN (2)
						SKULL_WHITE (3)
						SKULL_RED (4)
						SKULL_BLACK (5)

				Example
					local skullNames = {"Yellow", "Green", "White", "Red", "Black"}
					local creatureSkull = getCreatureSkullType(cid)
					if creatureSkull ~= SKULL_NONE then
						doPlayerSendTextMessage(cid, "Your current skull color is " .. skullNames[creatureSkull] .. ".")
					else
						doPlayerSendTextMessage(cid, "You don't have any skull :(")
					end

This is taken from file called LUA_FUNCTIONS

getCreatureSkullType(cid) doesn't get numbers but kinds of skull ( I posted them in CODE )

:)
 
Code:
getCreatureSkullType(cid)
				Info
					This function checks creature current skull.

				Returns
					Creature skull.
					For example:
						SKULL_NONE (0) - means, no SKULL_GREEN
						SKULL_YELLOW (1)
						SKULL_GREEN (2)
						SKULL_WHITE (3)
						SKULL_RED (4)
						SKULL_BLACK (5)

				Example
					local skullNames = {"Yellow", "Green", "White", "Red", "Black"}
					local creatureSkull = getCreatureSkullType(cid)
					if creatureSkull ~= SKULL_NONE then
						doPlayerSendTextMessage(cid, "Your current skull color is " .. skullNames[creatureSkull] .. ".")
					else
						doPlayerSendTextMessage(cid, "You don't have any skull :(")
					end

This is taken from file called LUA_FUNCTIONS

getCreatureSkullType(cid) doesn't get numbers but kinds of skull ( I posted them in CODE )

:)
And the kinds are the same thing as numbers, taken from constant.lua:
Code:
SKULL_NONE = 0
SKULL_YELLOW = 1
SKULL_GREEN = 2
SKULL_WHITE = 3
SKULL_RED = 4
SKULL_BLACK = 5
SKULL_LAST = SKULL_BLACK
 
Back
Top