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

Boat NPC for Free and VIP Account TFS 1.5

Solution
In modules.lua(npc folder/lib) search for:

Code:
StdModule.travel

Where is:

Lua:
        if parameters.premium and not player:isPremium() then
            npcHandler:say("I'm sorry, but you need a premium account in order to travel onboard our ships.", cid)
        elseif parameters.level and player:getLevel() < parameters.level then
            npcHandler:say("You must reach level " .. parameters.level .. " before I can let you go there.", cid)

Add(after or before level parameters)
Lua:
 elseif parameters.vip and not player:isVip() then
            npcHandler:say("I'm sorry, but you need a vip account in order to travel onboard our ships.", cid)

result:
Lua:
        if parameters.premium and not player:isPremium() then...
In modules.lua(npc folder/lib) search for:

Code:
StdModule.travel

Where is:

Lua:
        if parameters.premium and not player:isPremium() then
            npcHandler:say("I'm sorry, but you need a premium account in order to travel onboard our ships.", cid)
        elseif parameters.level and player:getLevel() < parameters.level then
            npcHandler:say("You must reach level " .. parameters.level .. " before I can let you go there.", cid)

Add(after or before level parameters)
Lua:
 elseif parameters.vip and not player:isVip() then
            npcHandler:say("I'm sorry, but you need a vip account in order to travel onboard our ships.", cid)

result:
Lua:
        if parameters.premium and not player:isPremium() then
            npcHandler:say("I'm sorry, but you need a premium account in order to travel onboard our ships.", cid)
        elseif parameters.vip and not player:isVip() then
            npcHandler:say("I'm sorry, but you need a vip account in order to travel onboard our ships.", cid)
        elseif parameters.level and player:getLevel() < parameters.level then
            npcHandler:say("You must reach level " .. parameters.level .. " before I can let you go there.", cid)


in npc script just put true if you want it to require vip and false if you don't need it(where is the parameters vip = true), in case the player is premium or not, it's the same thing, true or false (if you know how to make a common boat npc, you know how it works)

Lua:
local travelNode = keywordHandler:addKeyword({'vip city'}, StdModule.say, {npcHandler = npcHandler, text = 'Do you seek a passage to Vip city for 10 gold coins?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, vip = true, level = 0, cost = 10, destination = Position(32298, 32895, 6) })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, reset = true, text = 'Maybe another time, then.'})

I believe this works, I haven't tested it because I don't have otserv 1.x+ and I don't have a vip system, but I used the premium system as a base, test and tell me if it works.
 
Solution
In modules.lua(npc folder/lib) search for:

Code:
StdModule.travel

Where is:

Lua:
        if parameters.premium and not player:isPremium() then
            npcHandler:say("I'm sorry, but you need a premium account in order to travel onboard our ships.", cid)
        elseif parameters.level and player:getLevel() < parameters.level then
            npcHandler:say("You must reach level " .. parameters.level .. " before I can let you go there.", cid)

Add(after or before level parameters)
Lua:
 elseif parameters.vip and not player:isVip() then
            npcHandler:say("I'm sorry, but you need a vip account in order to travel onboard our ships.", cid)

result:
Lua:
        if parameters.premium and not player:isPremium() then
            npcHandler:say("I'm sorry, but you need a premium account in order to travel onboard our ships.", cid)
        elseif parameters.vip and not player:isVip() then
            npcHandler:say("I'm sorry, but you need a vip account in order to travel onboard our ships.", cid)
        elseif parameters.level and player:getLevel() < parameters.level then
            npcHandler:say("You must reach level " .. parameters.level .. " before I can let you go there.", cid)


in npc script just put true if you want it to require vip and false if you don't need it(where is the parameters vip = true), in case the player is premium or not, it's the same thing, true or false (if you know how to make a common boat npc, you know how it works)

Lua:
local travelNode = keywordHandler:addKeyword({'vip city'}, StdModule.say, {npcHandler = npcHandler, text = 'Do you seek a passage to Vip city for 10 gold coins?'})
    travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, vip = true, level = 0, cost = 10, destination = Position(32298, 32895, 6) })
    travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, reset = true, text = 'Maybe another time, then.'})

I believe this works, I haven't tested it because I don't have otserv 1.x+ and I don't have a vip system, but I used the premium system as a base, test and tell me if it works.
now when trying to travel, this error occurs when I say "yes"
ship.JPG
Post automatically merged:

It worked, I had forgotten to register this on login.lua
Lua:
        player:loadVipData()
        player:updateVipTime()
 
Last edited:
Back
Top