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

Solved Npc Give item for exp

Doomdice

The N00betarian
Joined
Jul 20, 2009
Messages
659
Reaction score
108
Location
Indiana
Current version tfs 1.2

I have found a script on here I edited a little of this script to make npc actually spawn but it not working the way i want it. I want this npc to give you exp for each of the same item you turn in so if u got 10 u turn in 10 at once u get 10k exp for turning 10 of the same item

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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(not npcHandler:isFocused(cid)) then
return false
end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
    if(msgcontains(msg, 'blood')) then
    selfSay('Hello have any blood?', cid)
    talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
    if (getPlayerStorageValue(cid,1237) > 0) then
else
    if(doPlayerRemoveItem(cid, 21417, 1) == TRUE) then
    setPlayerStorageValue(cid,1237,1)
    Player:addExperience (cid, 10000000)
    selfSay('Have you got any Blood Vial', cid)
else
    selfSay(' Get Get Away Now! No Blood! No Help! ', cid)
    end
return true
end


end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
1st off remove the scripter title underneath your avatar and second go learn lua, then you can put the scripter title back...

And finally most importantly don't pm me to look at your thread.
 
1st off remove the scripter title underneath your avatar and second go learn lua, then you can put the scripter title back...

And finally most importantly don't pm me to look at your thread.

After this indent the script too.
 
1st off remove the scripter title underneath your avatar and second go learn lua, then you can put the scripter title back...

And finally most importantly don't pm me to look at your thread.
Not sure why you go around discouraging people but I think his profile title is perfectly fine. He isn't stating that he is a pro or anything. He's still about to learn scripting. Leave him be.
 
Not sure why you go around discouraging people but I think his profile title is perfectly fine. He isn't stating that he is a pro or anything. He's still about to learn scripting. Leave him be.

I had my title actually scripter @Damon he was just being honest that I need to change it and dont like getting pm from me personally which i ask on this script once & like just looking at him his self and if he likes doing it he do it i guess i figure he give me a response back and say I look at it when i can or i wont look at it till later or I dont feel like helping you way it is from him.
 
I had my title actually scripter @Damon he was just being honest that I need to change it and dont like getting pm from me personally which i ask on this script once & like just looking at him his self and if he likes doing it he do it i guess i figure he give me a response back and say I look at it when i can or i wont look at it till later or I dont feel like helping you way it is from him.
Aight^^Well gl on solving the problem :)
 
Aight^^Well gl on solving the problem :)

Someone will help printer usually helps but i know he busy alot of times working on his ot mainly I just try to solve this and hopefully someone else will help me on this script to reformat it I didnt think anyone would literally post something telling me to learn how to script wish it great I need to learn but also i learn better if someone with me and telling me what I did wrong if I could find someone that will tell me then I learn alot more better but im more on at learning by someone telling me where i mess up my biggest thing is the space,commas or tabing the most biggest part long they dont mind me pming back n fourth inbox that be great.
 
@dicemangs your welcome
@Damon i wouldn't say i discourage people, if i was discouraging people i wouldn't even bother telling them to learn the language

This is 1 of if not the biggest problem in this community, people refuse to learn the supporting languages.. are we suppose to hold their hands forever?

I've been writing / updating / editing the same scripts for 800+ posts and people don't even try to comprehend the script you write, read the explanations or take the advice given.
 
@dicemangs your welcome
@Damon i wouldn't say i discourage people, if i was discouraging people i wouldn't even bother telling them to learn the language

This is 1 of if not the biggest problem in this community, people refuse to learn the supporting languages.. are we suppose to hold their hands forever?
No you are not supposed to do that. You are free to support people or not to do so. What you shouldn't do ist discouraging them what we both seem to define in different ways. Anyway eventually they will either start learning the language, continue to copy&paste or they will simply discontinue their project and leave ots. There are still plenty of other things to do in life.
 
https://otland.net/threads/how-to-tab-lua-scripts.203763/
Here's how to tab your current script properly. (or rather.. as well as possible.)
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
     return false
   end

   local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
  if(msgcontains(msg, 'blood')) then
     selfSay('Hello have any blood?', cid)
     talkState[talkUser] = 1
   elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
     if (getPlayerStorageValue(cid,1237) > 0) then
     else
       if(doPlayerRemoveItem(cid, 21417, 1) == TRUE) then
         setPlayerStorageValue(cid,1237,1)
         Player:addExperience (cid, 10000000)
         selfSay('Have you got any Blood Vial', cid)
       else
         selfSay(' Get Get Away Now! No Blood! No Help! ', cid)
       end
     -- never ends if statement
   -- never ends if statement
   return true
end


end -- bad end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
As we can see there are a few misplaced ends and else's, and a missing parameter if they are missing the item.
For what you want to do, you'd also want to remove the storage values, so the player can give the vial indefinitely.
Let's do both of those in sequence.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
     return false
   end

   local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
  if(msgcontains(msg, 'blood')) then
     selfSay('Hello have any blood?', cid)
     talkState[talkUser] = 1
   elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
     if (getPlayerStorageValue(cid,1237) > 0) then
     else
       if(doPlayerRemoveItem(cid, 21417, 1) == TRUE) then
         setPlayerStorageValue(cid,1237,1)
         Player:addExperience (cid, 10000000)
         selfSay('Have you got any Blood Vial', cid)
       else
         selfSay(' Get Get Away Now! No Blood! No Help! ', cid)
       end
     end
   end
   return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
This still doesn't make proper sense, but removing and changing some of the code we can fix that quickly enough.
Also the experience given is 10 million, not 10 thousand as you explained above. We will fix that oversight as well. (which is actually 10000/10 (1000 experience) per vial.)
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
     return false
   end

   local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
  if(msgcontains(msg, 'blood')) then
     selfSay('Hello have any blood?', cid)
     talkState[talkUser] = 1
   elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
     if(doPlayerRemoveItem(cid, 21417, 1) == TRUE) then
       Player:addExperience (cid, 1000)
       selfSay('Thank you. I have taken 1 blood vial in return for 1000 experience. Come again!', cid)
     else
       selfSay(' Get Get Away Now! No Blood! No Help! ', cid)
     end
     talkState[talkUser] = 0 -- we need to remove the players talkstate after it's given
   end
   return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Now we can give them the vial indefinitely.
But this can become tedious.. So we could change it to give 1 vial or all vials, yes?
Let's do that.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
         return false
     end

     local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
     
     if(msgcontains(msg, 'blood')) then
         selfSay('Hello have any blood?', cid)
         talkState[talkUser] = 1
     elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
         if getPlayerItemCount(cid, 21417) >= 1 then
             selfSay('Good mortal. Now are you going to give me {1 vial} or {all vials}?', cid)
             talkState[talkUser] = 2
         else
             selfSay('Get Get Away Now! No Blood! No Help!', cid)
             talkState[talkUser] = 0
         end
     elseif(msgcontains(msg, '1') and talkState[talkUser] == 2) then
         if(doPlayerRemoveItem(cid, 21417, 1) == TRUE) then
             Player:addExperience (cid, 1000)
             selfSay('Thank you. I have taken 1 blood vial in return for 1000 experience. Come again!', cid)
         else
             selfSay('Get Get Away Now! No Blood! No Help!', cid)
         end
         talkState[talkUser] = 0
     elseif(msgcontains(msg, 'all') and talkState[talkUser] == 2) then
         if getPlayerItemCount(cid, 21417) >= 1 then
             amount = getPlayerItemCount(cid, 21417)
             Player:addExperience (cid, (1000 * amount))
             doPlayerRemoveItem(cid, 21417, amount)
             selfSay('Thank you. I have taken all your blood vials in return for experience. Come again!', cid)
         else
             selfSay('Get Get Away Now! No Blood! No Help!', cid)
         end
         talkState[talkUser] = 0
     end
     return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
As you can see it's all relative to what you wish to do.
Now of course you could always add more, but I think this should be enough.

Note: none of this has been tested.
Also note: you are using 1.x, however I assume your compat file is responsible for allowing you to use 0.3.x scripting.
You'll want to learn how to use 1.x scripting style in the future to avoid possible confusion.
 
https://otland.net/threads/how-to-tab-lua-scripts.203763/
Here's how to tab your current script properly. (or rather.. as well as possible.)
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
     return false
   end

   local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

  if(msgcontains(msg, 'blood')) then
     selfSay('Hello have any blood?', cid)
     talkState[talkUser] = 1
   elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
     if (getPlayerStorageValue(cid,1237) > 0) then
     else
       if(doPlayerRemoveItem(cid, 21417, 1) == TRUE) then
         setPlayerStorageValue(cid,1237,1)
         Player:addExperience (cid, 10000000)
         selfSay('Have you got any Blood Vial', cid)
       else
         selfSay(' Get Get Away Now! No Blood! No Help! ', cid)
       end
     -- never ends if statement
   -- never ends if statement
   return true
end


end -- bad end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
As we can see there are a few misplaced ends and else's, and a missing parameter if they are missing the item.
For what you want to do, you'd also want to remove the storage values, so the player can give the vial indefinitely.
Let's do both of those in sequence.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
     return false
   end

   local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

  if(msgcontains(msg, 'blood')) then
     selfSay('Hello have any blood?', cid)
     talkState[talkUser] = 1
   elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
     if (getPlayerStorageValue(cid,1237) > 0) then
     else
       if(doPlayerRemoveItem(cid, 21417, 1) == TRUE) then
         setPlayerStorageValue(cid,1237,1)
         Player:addExperience (cid, 10000000)
         selfSay('Have you got any Blood Vial', cid)
       else
         selfSay(' Get Get Away Now! No Blood! No Help! ', cid)
       end
     end
   end
   return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
This still doesn't make proper sense, but removing and changing some of the code we can fix that quickly enough.
Also the experience given is 10 million, not 10 thousand as you explained above. We will fix that oversight as well. (which is actually 10000/10 (1000 experience) per vial.)
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
     return false
   end

   local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

  if(msgcontains(msg, 'blood')) then
     selfSay('Hello have any blood?', cid)
     talkState[talkUser] = 1
   elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
     if(doPlayerRemoveItem(cid, 21417, 1) == TRUE) then
       Player:addExperience (cid, 1000)
       selfSay('Thank you. I have taken 1 blood vial in return for 1000 experience. Come again!', cid)
     else
       selfSay(' Get Get Away Now! No Blood! No Help! ', cid)
     end
     talkState[talkUser] = 0 -- we need to remove the players talkstate after it's given
   end
   return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Now we can give them the vial indefinitely.
But this can become tedious.. So we could change it to give 1 vial or all vials, yes?
Let's do that.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
         return false
     end

     local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
   
     if(msgcontains(msg, 'blood')) then
         selfSay('Hello have any blood?', cid)
         talkState[talkUser] = 1
     elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
         if getPlayerItemCount(cid, 21417) >= 1 then
             selfSay('Good mortal. Now are you going to give me {1 vial} or {all vials}?', cid)
             talkState[talkUser] = 2
         else
             selfSay('Get Get Away Now! No Blood! No Help!', cid)
             talkState[talkUser] = 0
         end
     elseif(msgcontains(msg, '1') and talkState[talkUser] == 2) then
         if(doPlayerRemoveItem(cid, 21417, 1) == TRUE) then
             Player:addExperience (cid, 1000)
             selfSay('Thank you. I have taken 1 blood vial in return for 1000 experience. Come again!', cid)
         else
             selfSay('Get Get Away Now! No Blood! No Help!', cid)
         end
         talkState[talkUser] = 0
     elseif(msgcontains(msg, 'all') and talkState[talkUser] == 2) then
         if getPlayerItemCount(cid, 21417) >= 1 then
             amount = getPlayerItemCount(cid, 21417)
             Player:addExperience (cid, (1000 * amount))
             doPlayerRemoveItem(cid, 21417, amount)
             selfSay('Thank you. I have taken all your blood vials in return for experience. Come again!', cid)
         else
             selfSay('Get Get Away Now! No Blood! No Help!', cid)
         end
         talkState[talkUser] = 0
     end
     return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
As you can see it's all relative to what you wish to do.
Now of course you could always add more, but I think this should be enough.

Note: none of this has been tested.
Also note: you are using 1.x, however I assume your compat file is responsible for allowing you to use 0.3.x scripting.
You'll want to learn how to use 1.x scripting style in the future to avoid possible confusion.


thanks for this xikini it works but im still having the problem on receiveing the exp it does not give
 
I don't know 1.x scripting. Hopefully a full 0.3.7 scripting style will work. - shrugs -
Otherwise you'll need to find the proper functions.
Also, you should check your console for errors. They are your first immediate clue to the issue in your script.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
         return false
     end

     local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
   
     if msgcontains(msg, "blood") then
         selfSay("Hello have any blood?", cid)
         talkState[talkUser] = 1
     elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
         if getPlayerItemCount(cid, 21417) >= 1 then
             selfSay("Good mortal. Now are you going to give me {1 vial} or {all vials}?", cid)
             talkState[talkUser] = 2
         else
             selfSay("Get Get Away Now! No Blood! No Help!", cid)
             talkState[talkUser] = 0
         end
     elseif msgcontains(msg, "1") and talkState[talkUser] == 2 then
         if doPlayerRemoveItem(cid, 21417, 1) == TRUE then
             doPlayerAddExperience(cid, 1000)
             selfSay("Thank you. I have taken 1 blood vial in return for 1000 experience. Come again!", cid)
         else
             selfSay("Get Get Away Now! No Blood! No Help!", cid)
         end
         talkState[talkUser] = 0
     elseif msgcontains(msg, "all") and talkState[talkUser] == 2 then
         if getPlayerItemCount(cid, 21417) >= 1 then
             amount = getPlayerItemCount(cid, 21417)
             doPlayerAddExperience(cid, (1000 * amount))
             doPlayerRemoveItem(cid, 21417, amount)
             selfSay("Thank you. I have taken all your blood vials in return for experience. Come again!", cid)
         else
             selfSay("Get Get Away Now! No Blood! No Help!", cid)
         end
         talkState[talkUser] = 0
     end
     return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
I don't know 1.x scripting. Hopefully a full 0.3.7 scripting style will work. - shrugs -
Otherwise you'll need to find the proper functions.
Also, you should check your console for errors. They are your first immediate clue to the issue in your script.
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

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(not npcHandler:isFocused(cid)) then
         return false
     end

     local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
  
     if msgcontains(msg, "blood") then
         selfSay("Hello have any blood?", cid)
         talkState[talkUser] = 1
     elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
         if getPlayerItemCount(cid, 21417) >= 1 then
             selfSay("Good mortal. Now are you going to give me {1 vial} or {all vials}?", cid)
             talkState[talkUser] = 2
         else
             selfSay("Get Get Away Now! No Blood! No Help!", cid)
             talkState[talkUser] = 0
         end
     elseif msgcontains(msg, "1") and talkState[talkUser] == 2 then
         if doPlayerRemoveItem(cid, 21417, 1) == TRUE then
             doPlayerAddExperience(cid, 1000)
             selfSay("Thank you. I have taken 1 blood vial in return for 1000 experience. Come again!", cid)
         else
             selfSay("Get Get Away Now! No Blood! No Help!", cid)
         end
         talkState[talkUser] = 0
     elseif msgcontains(msg, "all") and talkState[talkUser] == 2 then
         if getPlayerItemCount(cid, 21417) >= 1 then
             amount = getPlayerItemCount(cid, 21417)
             doPlayerAddExperience(cid, (1000 * amount))
             doPlayerRemoveItem(cid, 21417, amount)
             selfSay("Thank you. I have taken all your blood vials in return for experience. Come again!", cid)
         else
             selfSay("Get Get Away Now! No Blood! No Help!", cid)
         end
         talkState[talkUser] = 0
     end
     return true
end

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




Y2LVZVZ.png


I got this error I change doplayerexp to player:experience it wasnt giving still after u remade it for me and now im having problem on a new line.
 
I got this error I change doplayerexp to player:experience it wasnt giving still after u remade it for me and now im having problem on a new line.
Do you have a docs directory? if so do you have a functions file, anything named functions, if so post it here or on pastebin.com
 
Back
Top