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

RevScripts [1.3 tfs] Add lvl req to NPC

walltimer

Active Member
Joined
Aug 5, 2020
Messages
170
Reaction score
26
How do i change this script so NPC will talk/teleport onlny 400lvl and more ?
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)
npcHandler:eek:nCreatureAppear(cid)
end
function onCreatureDisappear(cid)
npcHandler:eek:nCreatureDisappear(cid)
end
function onCreatureSay(cid, type, msg)
npcHandler:eek:nCreatureSay(cid, type, msg)
end
function onThink()
npcHandler:eek:nThink()
end

local voices = { {text = 'Do you want to go top of the mountain? .'} }
npcHandler:addModule(VoiceModule:new(voices))

-- Travel
local travelKeyword = keywordHandler:addKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, text = 'Do you realy want to go up for |TRAVELCOST|?', cost = 1000000, discount = 'postman'})
travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, cost = 1000000, discount = 'postman', destination = Position(935, 289, 1)})
travelKeyword:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, text = 'By direct edict of the honorable Henricus himself... well, you know.', reset = true})
keywordHandler:addAliasKeyword({'town'})

-- Kick
keywordHandler:addKeyword({'kick'}, StdModule.kick, {npcHandler = npcHandler, destination = {Position(936, 290, 1)}})

-- Basic
keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, text = "uh?"})

npcHandler:setMessage(MESSAGE_GREET, "Welcome, |PLAYERNAME| Ready to go up?")
npcHandler:setMessage(MESSAGE_FAREWELL, "Oh...")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye then.")
npcHandler:addModule(FocusModule:new())
 
Just add this to the table: level = 400
per example: travelKeyword:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 400, cost = 1000000, discount = 'postman', destination = Position(935, 289, 1)})
 
Back
Top