• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Npc Experience free tfs 1.0

samuelav3

Member
Joined
Aug 18, 2014
Messages
95
Reaction score
5
someone help me with some script for this npc
for lvls 1
you talk to your

Hi
Adventure
yes

and give you 6400 exp free
ty
 
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

local storage = 54764

local function creatureSayCallback(cid, type, msg)
     if not npcHandler:isFocused(cid) then
         return false
     end
   
     local player = Player(cid)
     if msgcontains(msg, "adventure") then
         if player:getStorageValue(storage) == -1 then
             npcHandler:say("Do you want some kind of adventure and get 6400 exp?", cid)
             npcHandler.topic[cid] = 1
         else
             npcHandler:say("You already had it.", cid)
         end
     elseif msgcontains(msg, "yes") and npcHandler.topic[cid] == 1 then
         npcHandler:say("Here you are.", cid)
         player:setStorageValue(storage, 1)
         player:addExperience(6400)
         npcHandler.topic[cid] = 0
     end
     return true
end

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