• 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:
Back
Top