local talkState = {}
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
local player =...
yes, I make ots for 3 people onlyonly 10 soul points for 500 gp?
local talkState = {}
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
local player = Player(cid)
if(msgcontains(msg, 'soul')) then
if player:getMoney() > 500 then
selfSay('do you want to buy 10 soul points for 500 gp?', cid)
talkState[talkUser] = 1
else
selfSay('sorry you need atleast 500 gps.', cid)
talkState[talkUser] = 0
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if player:getMoney() > 500 then
player:removeMoney(500)
player:addSoul(soulChange)
selfSay('You have bought 10 soul points.', cid)
talkState[talkUser] = 0
else
selfSay('sorry you need atleast 500 gps.', cid)
end
end
return false
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Dont add soul pointsLUA:local talkState = {} local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 local player = Player(cid) if(msgcontains(msg, 'soul')) then if player:getMoney() > 500 then selfSay('do you want to buy 10 soul points for 500 gp?', cid) talkState[talkUser] = 1 else selfSay('sorry you need atleast 500 gps.', cid) talkState[talkUser] = 0 end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if player:getMoney() > 500 then player:removeMoney(500) player:addSoul(soulChange) selfSay('You have bought 10 soul points.', cid) talkState[talkUser] = 0 else selfSay('sorry you need atleast 500 gps.', cid) end end return false end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
how it works
hi
soul
yes
done
Works! Thank you very muchplayer:addSoul(soulChange)
to
player:addSoul(10)
And I have one more question. What a command to buy premium points for money from game not for real money?player:addSoul(soulChange)
to
player:addSoul(10)