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

Lua TextType & NpcHandler TFS 1.0

Anghelos

Member
Joined
Nov 1, 2014
Messages
30
Reaction score
10
Hi all,
My problem is that i'm trying to redo the marriage script, taking into account also the outfit add and meluna honeymoon. I would like to add a touch of RPG in this script, so I want that the Priest NPC shout the marriage formula so that every person attending the wedding can 'hear' what's going on, so basically, i would like to use the 'orange' talk.... Problem is that i cannot...maybe i mistake something or maybe the npcHandler:Say doesn't allow the type argument.

i tried using the npcHandler:OnCreatureSay but still it doesn't work, or maybe i'm mistaking something....any help?
 
can you be more specific....? ^_^' writing like that return an error.
Sorry, i'm quite noob in scripting for this language and i'm just trying to figure out things.

AFAIU I should always use the NPCHandler to make npc talk, but i already tried the npcHandler:Say ...



EDIT: Well, i solved using Selfsay, it isn't orange, but is fine anyway....if u want to add exactly how to do that in orange would be nice, at least i will learn something else :)

EDIT2: Ah! I guess I get it... it is used in the ONTHINK trigger... and not in NPCHANDLER... right?
 
Last edited:
Add it in function creatureSayCallback(cid, type, msg), same as where you have selfSay or any kind of respond from the npc.
Npc() is npc userdata, so it will work just like Player(cid) but then for the npcs instead of the player.
 
Understood, now I need one more thing, the MoveUp function, what is about? why it is used (usually with keywordHandler)? I can't understand, but seems like a callback to something else.
Can u link some kind of tutorial where can I found those (and prolly other) answers?

One more question, to add "something" to another character whic is NOT the one that is talking to the NPC i used this trick:

Code:
            npcHandler:say('Since both of you are willing to marry, I accept to celebrate your marriage, go prepare yourself, and tell me when you are ready for the {celebration}',cid)
                        player:removeItem(ITEM_WEDDING_RING,1)
                        player:removeItem(10503,1) -- wedding outfit box
            player:addOutfit(329) --Wife
            player:addOutfit(328) --Husb
                        setPlayerMarriageStatus(player:getGuid(), PROPACCEPT_STATUS)
                        setPlayerMarriageStatus(candidate, PROPACCEPT_STATUS)
            local player = Player(getPlayerNameById(candidate))
            player:addOutfit(329)
            player:addOutfit(328)

Which to me seems like a 'dirty' solution... Now, before this i wrote something like this but didn't work:
Code:
            local player2 = Player(getPlayerNameById(candidate))
            npcHandler:say('Since both of you are willing to marry, I accept to celebrate your marriage, go prepare yourself, and tell me when you are ready for the {celebration}',cid)
                        player:removeItem(ITEM_WEDDING_RING,1)
                        player:removeItem(10503,1) -- wedding outfit box
            player:addOutfit(329) --Wife
            player:addOutfit(328) --Husb
            player2:addOutfit(329)
            player2:addOutfit(328)
                        setPlayerMarriageStatus(player:getGuid(), PROPACCEPT_STATUS)
                        setPlayerMarriageStatus(candidate, PROPACCEPT_STATUS)

but i had error on player2 =/
 
How did you define candidate and what was the error? You cold just add the player name to a table, like how talkState works.
Code:
local m = {} -- above the function

m[cid] = msg -- when saying the name
 
Back
Top