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

Lua npc Marina

Lbtg

Intermediate OT User
Joined
Nov 22, 2008
Messages
2,311
Reaction score
133
Hello i have issue with npc Marina ,

After giving 50 honeycomb it works good , after i
say silk yarn
npc says:Marina: Okay... a deal is a deal, would you like me to create a spool of yarn from 10 pieces of spider silk?
i say:yes , and nothing happens trying changing code how i can but nothing helps

thats the current script
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}
local storage = 8647

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 greetCallback(cid)
  local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
  Topic[talkUser] = 0
    return true
end

function creatureSayCallback(cid, type, msg)

  if(not npcHandler:isFocused(cid)) then
    return false
  end

  local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
  if msgcontains(msg, "silk yarn") and getPlayerStorageValue(cid, storage) == 3 then
    npcHandler:say("Okay... a deal is a deal, would you like me to create a spool of yarn from 10 pieces of spider silk?", cid)
    Topic[talkUser] = 4
    elseif msgcontains(msg, "yes") and Topic[talkUser] == 1 and getPlayerStorageValue(cid, storage) == 3 and getPlayerItemCount(cid, 5879) >= 10 then
    npcHandler:say("Ew... gooey... there you go.", cid)
    doPlayerAddItem(cid, 5886, 1)
    Topic[talkUser] = 0
  elseif msgcontains(msg, "silk yarn") and getPlayerStorageValue(cid, storage) < 1 then
    npcHandler:say("Um. You mean, you really want me to touch that gooey spider silk just because you need yarn? Well... do you think that I'm pretty?", cid)
    Topic[talkUser] = 1
  elseif msgcontains(msg, "yes") and Topic[talkUser] == 1 and getPlayerStorageValue(cid, storage) < 1 then
    npcHandler:say({"Well, everyone would say that in your position. Do you think that I'm really, absolutely the most stunning being that you have ever seen?"}, cid)
    Topic[talkUser] = 2
  elseif msgcontains(msg, "yes") and Topic[talkUser] == 2 and getPlayerStorageValue(cid, storage) < 1 then
    npcHandler:say({"<giggles> It's funny how easy it is to get humans to say what you want. Now, proving it will be even more fun! ...", "You want me to touch something gooey, so you have to touch something gooey for me too. <giggles> ...", "I love honey and I haven't eaten it in a while, so bring me 50 honeycombs and worship my beauty a little more, then we will see."}, cid)
    Topic[talkUser] = 0
    setPlayerStorageValue(cid, storage, 2)
    elseif msgcontains(msg, "50 honeycombs") and getPlayerStorageValue(cid, storage) == 2 then
    npcHandler:say({"Did you bring me the 50 honeycombs I requested and do you absolutely admire my beauty?"}, cid)
    Topic[talkUser] = 3
    elseif msgcontains(msg, "yes") and Topic[talkUser] == 3 and getPlayerStorageValue(cid, storage) == 2 and getPlayerItemCount(cid, 5902) >= 50 then
    npcHandler:say({"Oh goodie! Thank you! Okay... I guess since my fingers are sticky now anyway, I will help you. From now on, if you bring me 10 pieces of spider silk, I will create one spool of yarn."}, cid)
    doPlayerRemoveItem(cid, 5902, 50)
    Topic[talkUser] = 0
    setPlayerStorageValue(cid, storage, 3)
  end
  return TRUE
end

npcHandler:setMessage(MESSAGE_GREET, "Greetingz, competitor.")
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Topic[talkUser] = 4
and Topic[talkUser] == 1

also.. why aren't you removing the spider silks?
More cheese. :x
 
Topic[talkUser] = 4
and Topic[talkUser] == 1

also.. why aren't you removing the spider silks?
More cheese. :x
oke now it works , but if player doesnt have items it need plyer say you dont have enought spider silks .
i tryed do else do message , but npc didint worked at all :D..
thanks for hint :)
 
In a gaming scene the word cheese is used to describe strategies or ways of playing that are really powerful and do not require much skill from the player.

To be more blunt, it's something that allows a player an advantage.
This can be called a glitch or a hack or a simple oversight from the game developer.

In this case, by not removing the items from the player, the player can talk to the npc and obtain unlimited "silk yarn".

As these items are usually considered rare, this would be great cheese for the first player to figure it out.
 
In a gaming scene the word cheese is used to describe strategies or ways of playing that are really powerful and do not require much skill from the player.

To be more blunt, it's something that allows a player an advantage.
This can be called a glitch or a hack or a simple oversight from the game developer.

In this case, by not removing the items from the player, the player can talk to the npc and obtain unlimited "silk yarn".

As these items are usually considered rare, this would be great cheese for the first player to figure it out.
But you can't get unlimited silk yarn ?or you see a way? :O
thanks for explaining trying to figure it out more :)
 
hi
silk yarn
yes
yes
bye
hi
50 honeycombs
yes
bye
hi
silk yarn
yes
silk yarn
yes
silk yarn
yes
silk yarn
yes
.
.
.
yeah but it doesnt work , before it didint even give spool of yarn , now i fixed it to give for 10 silks 1 yarn , it doesnt bug brother.

what you mean ?
 
I'm only going with the script you posted earlier.
If you have 50 honeycombs and 10 silk on you, and said the same word as what i posted, you'd have infinite yarn.

- Edit

Again, assuming you've only changed the original issue you posted about.
 
Last edited:
code is bugged, looks like you are using one from 2010~, here's fix:

change this:
Code:
  elseif msgcontains(msg, "yes") and Topic[talkUser] == 1 and getPlayerStorageValue(cid, storage) == 3 and getPlayerItemCount(cid, 5879) >= 10 then
with this:
Code:
  elseif msgcontains(msg, "yes") and Topic[talkUser] == 4 and getPlayerStorageValue(cid, storage) == 3 and getPlayerItemCount(cid, 5879) >= 10 then


to get ablility to exchange silks:
Code:
hi
silk yarn
yes
yes
50 honeycombs
yes
after that you can change 10 silks to one yarn with:
Code:
silk yarn
yes
 
code is bugged, looks like you are using one from 2010~, here's fix:

change this:
Code:
  elseif msgcontains(msg, "yes") and Topic[talkUser] == 1 and getPlayerStorageValue(cid, storage) == 3 and getPlayerItemCount(cid, 5879) >= 10 then
with this:
Code:
  elseif msgcontains(msg, "yes") and Topic[talkUser] == 4 and getPlayerStorageValue(cid, storage) == 3 and getPlayerItemCount(cid, 5879) >= 10 then


to get ablility to exchange silks:
Code:
hi
silk yarn
yes
yes
50 honeycombs
yes
after that you can change 10 silks to one yarn with:
Code:
silk yarn
yes

Yes andu it might be something from that year ^^ :) very good guess.
and i made it to work , and diidnt bug before it just didint gave anything after 50 honeycomb mission
aswell thanks alot , what else i wanna do in this npc is that
if player doesnt have enought silks he gets cancel message '' you don't have enought silks you human '
can help with it please ? :)

thanks in advance

aswell there is my current npc
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic = {}
local storage = 8647

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 greetCallback(cid)
  local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
  Topic[talkUser] = 0
    return true
end

function creatureSayCallback(cid, type, msg)

  if(not npcHandler:isFocused(cid)) then
    return false
  end

  local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
  if msgcontains(msg, "silk yarn") and getPlayerStorageValue(cid, storage) == 3 then
    npcHandler:say("Okay... a deal is a deal, would you like me to create a spool of yarn from 10 pieces of spider silk?", cid)
    Topic[talkUser] = 4
    elseif msgcontains(msg, "yes") and Topic[talkUser] == 4 and getPlayerStorageValue(cid, storage) == 3 and getPlayerItemCount(cid, 5879) >= 10 then
    npcHandler:say("Ew... gooey... there you go.", cid)
    doPlayerAddItem(cid, 5886, 1)
    Topic[talkUser] = 0
  elseif msgcontains(msg, "silk yarn") and getPlayerStorageValue(cid, storage) < 1 then
    npcHandler:say("Um. You mean, you really want me to touch that gooey spider silk just because you need yarn? Well... do you think that I'm pretty?", cid)
    Topic[talkUser] = 0
  elseif msgcontains(msg, "yes") and Topic[talkUser] == 1 and getPlayerStorageValue(cid, storage) < 1 then
    npcHandler:say({"Well, everyone would say that in your position. Do you think that I'm really, absolutely the most stunning being that you have ever seen?"}, cid)
    Topic[talkUser] = 2
  elseif msgcontains(msg, "yes") and Topic[talkUser] == 2 and getPlayerStorageValue(cid, storage) < 1 then
    npcHandler:say({"<giggles> It's funny how easy it is to get humans to say what you want. Now, proving it will be even more fun! ...", "You want me to touch something gooey, so you have to touch something gooey for me too. <giggles> ...", "I love honey and I haven't eaten it in a while, so bring me 50 honeycombs and worship my beauty a little more, then we will see."}, cid)
    Topic[talkUser] = 0
    setPlayerStorageValue(cid, storage, 2)
    elseif msgcontains(msg, "50 honeycombs") and getPlayerStorageValue(cid, storage) == 2 then
    npcHandler:say({"Did you bring me the 50 honeycombs I requested and do you absolutely admire my beauty?"}, cid)
    Topic[talkUser] = 3
    elseif msgcontains(msg, "yes") and Topic[talkUser] == 3 and getPlayerStorageValue(cid, storage) == 2 and getPlayerItemCount(cid, 5902) >= 50 then
    npcHandler:say({"Oh goodie! Thank you! Okay... I guess since my fingers are sticky now anyway, I will help you. From now on, if you bring me 10 pieces of spider silk, I will create one spool of yarn."}, cid)
    doPlayerRemoveItem(cid, 5902, 50)
    Topic[talkUser] = 0
    setPlayerStorageValue(cid, storage, 3)
  end
  return TRUE
end

npcHandler:setMessage(MESSAGE_GREET, "Greetingz, competitor.")
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

i think its same w
 
what else i wanna do in this npc is that
if player doesnt have enought silks he gets cancel message '' you don't have enought silks you human '
can help with it please ? :)

change this (29-32 lines):
Code:
elseif msgcontains(msg, "yes") and Topic[talkUser] == 4 and getPlayerStorageValue(cid, storage) == 3 and getPlayerItemCount(cid, 5879) >= 10 then
    npcHandler:say("Ew... gooey... there you go.", cid)
    doPlayerAddItem(cid, 5886, 1)
    Topic[talkUser] = 0
with this:
Code:
elseif msgcontains(msg, "yes") and Topic[talkUser] == 4 and getPlayerStorageValue(cid, storage) == 3 then
    if getPlayerItemCount(cid, 5879) >= 10 then
        npcHandler:say("Ew... gooey... there you go.", cid)
        doPlayerAddItem(cid, 5886, 1)
        doPlayerRemoveItem(cid, 5879, 10)
    else
        npcHandler:say("You don\'t have enought silks you human.", cid)
    end
    Topic[talkUser] = 0
 

Similar threads

Back
Top