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

Lua Quick help on a NPC

Siegh

Thronar Developer
Joined
Mar 12, 2011
Messages
1,282
Solutions
1
Reaction score
645
Location
Brazil
Hello =D, I need a quick help on this issue I'm having with a script. The thing is, I don't know how to do this on Lua even though it's probably pretty basic.

Code:
elseif msgcontains(msg, "withdrawn") then
    npcHandler:say("How much do you wish to withdrawn?",cid)

How do I get the answer from the player to use as a variable on the NPC's next line? For example: withdrawn, 100, yes (withdrawn 100 gold from bank account).
 
Solution
Hello =D, I need a quick help on this issue I'm having with a script. The thing is, I don't know how to do this on Lua even though it's probably pretty basic.

Code:
elseif msgcontains(msg, "withdrawn") then
    npcHandler:say("How much do you wish to withdrawn?",cid)

How do I get the answer from the player to use as a variable on the NPC's next line? For example: withdrawn, 100, yes (withdrawn 100 gold from bank account).

The "msg" variable is the player's reply, the same one used here -> msgcontains(msg, "withdrawn").
So you could do
LUA:
npcHandler:say("Do you really wish to withdraw " ..msg.. " gold from your bank account?",cid)
Hello =D, I need a quick help on this issue I'm having with a script. The thing is, I don't know how to do this on Lua even though it's probably pretty basic.

Code:
elseif msgcontains(msg, "withdrawn") then
    npcHandler:say("How much do you wish to withdrawn?",cid)

How do I get the answer from the player to use as a variable on the NPC's next line? For example: withdrawn, 100, yes (withdrawn 100 gold from bank account).

The "msg" variable is the player's reply, the same one used here -> msgcontains(msg, "withdrawn").
So you could do
LUA:
npcHandler:say("Do you really wish to withdraw " ..msg.. " gold from your bank account?",cid)
 
Solution
Back
Top