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

[Creaturescript] What's wrong please!

Delvire

°£°
Joined
Feb 24, 2008
Messages
236
Reaction score
9
Hello everybody. I am having trouble with my script:

LUA:
function onKill(cid, target)

local counter = 0
local stg = 20008

 if isCreature(target) then
  if (getCreatureName(target) == 'Mutated Human') then
setPlayerStorageValue(cid, stg, (counter + 1))

return TRUE
   end
    if getPlayerStorageValue(cid, stg) >= 300 then
doCreatureSay(cid, "You are now able to kill the boss of the mutated humans.", TALKTYPE_ORANGE_1)
counter = 0

return FALSE
 end
  end
    end

In this script, after killing 300 (or more) mutated humans, the player should receive a message saying that he is able to kill their boss. But it doesn't happen :(

There are no error messages in console and I have already added the event into the mutated human.xml file

Thanks anyone who help me and rep++ ofc

ah, and Yes, I am noob at lua
 
registerCreatureEvent(cid, 'eventname') goes into login.lua, and remove the thing from the xml file of monster
LUA:
function onKill(cid, target, lastHit)
	if isMonster(target) and getCreatureName(target) == 'Mutated Human' then
		local n = math.max(0, getCreatureStorage(cid, 20008)) + 1
		if n <= 300 then
			doCreatureSetStorage(cid, 20008, n)
			if n == 300 then
				doCreatureSay(cid, 'You are now able to kill the boss of the mutated humans.', TALKTYPE_ORANGE_1)
			end
		end
	end
	return true
end
 
Last edited:
Going to test, give me 1 min :)

EDIT:
nothing happens :(

EDIT 2:
Kill any monster then
Kill Mutated Human
Message will appear without stop(unless u logout)
all monsters except the Mutated Humans are not dying!
 
Last edited:
Back
Top