Guest User

Untitled

a guest
Jun 4th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. ---------------------------- money exchange --------------
  2.     elseif msgcontains(msg, 'change gold') then
  3.         npcHandler:say("How many platinum coins would you like to get?", cid)
  4.         talkState[cid] = 14
  5.     elseif talkState[cid] == 14 then
  6.         if getCount(msg) == -1 or getCount(msg) == 0 then
  7.             npcHandler:say("Hmm, can I help you with something else?", cid)
  8.             talkState[cid] = 0
  9.         else
  10.             count[cid] = getCount(msg)
  11.             npcHandler:say("So you would like me to change " .. count[cid] * 100 .. " of your gold coins into " .. count[cid] .. " platinum coins?", cid)
  12.             talkState[cid] = 15
  13.         end
  14.     elseif talkState[cid] == 15 then
  15.         if msgcontains(msg, 'yes') then
  16.             if doPlayerRemoveItem(cid, 2148, count[cid] * 100) then
  17.                 doPlayerAddItem(cid, 2152, count[cid])
  18.                 npcHandler:say("Here you are.", cid)
  19.             else
  20.                 npcHandler:say("Sorry, you do not have enough gold coins.", cid)
  21.             end
  22.         else
  23.             npcHandler:say("Well, can I help you with something else?", cid)
  24.         end
  25.         talkState[cid] = 0
Add Comment
Please, Sign In to add comment