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

My riddler and items script

Ninkobi

Owner /Founder of Syphera
Joined
Apr 5, 2008
Messages
206
Reaction score
1
Location
England
My riddler is currently not working netiher is my sacrifice items script someone please help:
Ridder
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)			npcHandler:onCreatureAppear(cid)			end
function onCreatureDisappear(cid)		npcHandler:onCreatureDisappear(cid)			end
function onCreatureSay(cid, type, msg)	npcHandler:onCreatureSay(cid, type, msg)	end
function onThink()						npcHandler:onThink()						end

function creatureSayCallback(cid, type, msg)
	if(npcHandler.focus ~= cid) then
		return FALSE
	end
	
local outPos={x=34465,y=32591,z=7}
local passPos={x=34433,y=32525,z=13}

	if(msgcontains(msg,'test') or msgcontains(msg,'pass'))then
		npcHandler:say("Would you like to take the test?")
		talkState=1
	end
	if(talkState==1) and (msgcontains(msg,'yes')) then
    npcHandler:say("Then here we go: what was the name of Xerxes' favourite assistant?")
    talkState=2
  else
    npcHandler:say("Then go!")
    talkState=10
  end
  if(talkState==2) and (msgcontains(msg,'manubis')) then
    npcHandler:say("Correct! First time lucky.. What colour was the cloth with a sign saying Two above it?")
    talkState=3
  else
    npcHandler:say("WRONG!")
    talkState=11
  end
  if(talkState==3) and (msgcontains(msg,'blue')) then
    npcHandler:say("Correct again! You won't get this. What colour did the flag with a letter T have?")
    talkState=4
  else
    npcHandler:say("WRONG!")
    talkState=12
  end
  if(talkState==4) and (msgcontains(msg,'green')) then
    npcHandler:say("Oh my GOD! Who was the only survivor of the warlock race?")
    talkState=5
  else
    npcHandler:say("WRONG!")
    talkState=13
  end
  if(talkState==5) and (msgcontains(msg,'xerxes')) then
    npcHandler:say("THIS CAN NOT BE HAPPENING! What is Xerxes favourite number?")
    talkState=6
  else
    npcHandler:say("WRONG!")
    talkState=14
  end
  if(talkState==6) and (msgcontains(msg,'ten') or msgcontains(msg,'10')) then
    npcHandler:say("You have passed the test!")
    doTeleportThing(cid,passPos,0)
    doSendMagicEffect(passPos,10)
    talkState=7
  else
    npcHandler:say("WRONG!")
    talkState=15
	elseif talkState > 11 then
    doTeleportThing(cid,outPos,0)
    doSendMagicEffect(outPos,10)
  end
  return TRUE
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Sacrifice Items
Code:
function onUse(cid, item, frompos, item2, topos)
    piece1 = 2695 --egg
    piece2	= 2674 --apple
    piece3	= 2682 --melon
    print("Well, at least the function is being called.")
    print("The parameters are:",item.uid,item.itemid)
    if item.uid == 36000 and item.itemid == 1945 then
        print("The if is ok.")
	piece1pos = {x=34433, y=32518, z=15, stackpos=1} -- Where the first piece will be placed
	getpiece1 = getThingfromPos(piece1pos)
        print("The first item is: ",getItemName(getpiece1.itemid),"("..getpiece1.itemid..")")
	piece2pos = {x=34434, y=32518, z=15, stackpos=1} -- Where the second piece will be placed
	getpiece2 = getThingfromPos(piece2pos)
        print("The second item is: ",getItemName(getpiece2.itemid),"("..getpiece2.itemid..")")
	piece3pos = {x=34432, y=32518, z=15, stackpos=1} -- Where the third piece will be placed
	getpiece3 = getThingfromPos(piece3pos)
        print("The third item is: ",getItemName(getpiece3.itemid),"("..getpiece3.itemid..")")
        if (getpiece1.itemid==piece1) and (getpiece2.itemid==piece2) and (getpiece3.itemid==piece3) then
           print("Everything is fine, now the main code will be executed.")
	   gatepos = {x=34433, y=32526, z=15, stackpos=1}
   	   doCreateItem(1386,1,gatepos)
   	   doTransformItem(item.uid,1946)
           doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have broken the seal! You may pass!')
       else
           doPlayerSendCancel(cid,"Sorry not possible.")
       end
   else
      doPlayerSendCancel(cid,"Sorry not possible.")
   end
return 1
end
 
You can't use else after the "msgcontains" function, it doesnt work.

About the second script, getThingfromPos should be getThingFromPos and getItemName in TFS (if u use TFS) is getItemNameById(itemid).
 
Back
Top