Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------- money exchange --------------
- elseif msgcontains(msg, 'change gold') then
- npcHandler:say("How many platinum coins would you like to get?", cid)
- talkState[cid] = 14
- elseif talkState[cid] == 14 then
- if getCount(msg) == -1 or getCount(msg) == 0 then
- npcHandler:say("Hmm, can I help you with something else?", cid)
- talkState[cid] = 0
- else
- count[cid] = getCount(msg)
- npcHandler:say("So you would like me to change " .. count[cid] * 100 .. " of your gold coins into " .. count[cid] .. " platinum coins?", cid)
- talkState[cid] = 15
- end
- elseif talkState[cid] == 15 then
- if msgcontains(msg, 'yes') then
- if doPlayerRemoveItem(cid, 2148, count[cid] * 100) then
- doPlayerAddItem(cid, 2152, count[cid])
- npcHandler:say("Here you are.", cid)
- else
- npcHandler:say("Sorry, you do not have enough gold coins.", cid)
- end
- else
- npcHandler:say("Well, can I help you with something else?", cid)
- end
- talkState[cid] = 0
Add Comment
Please, Sign In to add comment