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

Language NPC

DestinationSer

@echo off
Joined
Mar 7, 2009
Messages
2,806
Solutions
1
Reaction score
676
Hey! I want a special language npc.
Like this

Player: hi
Npc: Hello <playername>, Do you want me to instruct you on Spanish, Polish or English?

Spanish language - When player says Spanish.
Player: Spanish
NPC: Hola. ¿Quieres que te ayude a <Huntings>, <Quests>, O <items>?
Player: Huntings
NPC: Los cazas es donde dice teleports más de un signo
Player: Quests
NPC: En Misiones se puede obtener artículos muy raros, obtener una promoción especial u obtener servicios de salud / maná refuerzos.
Player: Items
NPC: Ah, ahora entiendo lo que estás diciendo. Usted desea que los elementos ¿no? Ok. Ir a los jefes que está en cacerías. Mira la señal y ver el nivel requerido para ellos.

Polish language - When player says Polish
Player: Polish
NPC: Hello! Czy potrzebujesz pomocy <Huntings> i <Quests> lub <Items>?
Player: Huntings
NPC: Musisz iść polowanie? Ok. Idź dbać znak tam stoi "teleportów" Jej tuż obok pokoju, w zajezdni tam trony jest. trzeci teleport po prawej stronie. Spójrz na znak, powinien powiedzieć "teleportów" Jeśli tak jest, przejdź w nim.
Player: Quests
NPC: Och, hehe. Widzę, że potrzebujesz pomocy z zadaniami prawda? Źle Cię. Jeśli pójdziesz do questów teleport widać, że nie ma różne misje, questy dla promocji, questy dla krzykaczy i coś w tym stylu. Gorąco dont Polecam Ci wejść, jeśli jesteś niski poziom.
Player: Items
NPC: Potrzebujesz pomocy w pozycji? Zobaczysz bossów w polowań, prawda? Cóż, jeśli patrzeć na znaki nie pojawi się wymagany poziom na przetrwanie bossa. Wpisz jeden na swoim poziomie i wyzwanie szefa. Nie mogę obiecać, że będzie ich właścicielem. Jakiś rodzaj szefów leczy dużo i tych, potrzebujesz pomocy.

English Language - When player says English
Player: English
NPC: Hello! I can offer you my help! Just say what you need help with is it <Huntings>, <Quests> or <Items>?
Player: Huntings
NPC: Ok, If you look at the signs in depot, you can see there is several teleports with several destinations. You will find a "Teleports" Sign over a teleport in there. if you go in there you will come directly to the huntings with bosses and prestige teleports.
Player: Quests
NPC: Oh, Hehe. I can see you need help with Quests huh? well you see if you go in the Quests teleport you will come to a room where its several teleports that leads to a quest. I highly dont recommend you to go in there if you are low level. Because those quests are for example: Boosters, promotion and exp quests.
Player: Items
NPC: Yeah, I get this question alot. You need help with Items am i right? Well yes you do. So, you see the bosses in the huntings? On the signs there it stands a required level to kill it. You can enter at any level but you should enter when you are the required level. Those bosses drops set, those sets gives you magic levels. Those magic levels makes you stronger.

Hope anybody can do this :)
 
PHP:
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, "spanish")) then
            npcHandler:say("Hola. ¿Quieres que te ayude a {Huntings}, {Quests}, O {items}?", cid)
		talkState[talkUser] = 1		
        end
		if (msgcontains(msg, "huntings")) and talkState[talkUser] == 1 then
            npcHandler:say("Los cazas es donde dice teleports más de un signo", cid)
		talkState[talkUser] = 1
        end
		if (msgcontains(msg, "quests")) then
            npcHandler:say("En Misiones se puede obtener artículos muy raros, obtener una promoción especial u obtener servicios de salud / maná refuerzos.", cid)
		talkState[talkUser] = 1
        end
		if (msgcontains(msg, "items")) and talkState[talkUser] == 1 then
            npcHandler:say("Ah, ahora entiendo lo que estás diciendo. Usted desea que los elementos ¿no? Ok. Ir a los jefes que está en cacerías. Mira la señal y ver el nivel requerido para ellos.", cid)
		talkState[talkUser] = 1
        end
        end
Just copy and paste from the spanish part until the end, and fill in what you want for the other languagues
 
You can use my language system look here

only cheking and replacing the msg in npcHandler:Say(x)
LUA:
-- If you have 2 languages registred you can check if the player have the english language, then if the player dont have English by languange, Spanish will be the final option choosed 

-- Example 

npcHandler:say((getPlayerLanguage(cid) == ENGLISH and "Hello you want go to {Huntings}, {Quests}, or {Items}." or "Hola. ¿Quieres que te ayude a {Huntings}, {Quests}, O {items}?", cid))
 
Last edited:
Back
Top