Kawaki69
Member
- Joined
- Mar 4, 2022
- Messages
- 72
- Reaction score
- 8
Hey, I need to add money check if you have enough money to rebirth for example an 200 from this id 6536 or gold coin to rebirth may some 1 help
ty
ty
Lua:
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 player = Player(cid)
local reblevel = 700000 -- reborn level
if(msgcontains(msg, 'rebirth')) then
selfSay('Are you ready to be reborn and to start a new life?', cid)
elseif(msgcontains(msg, 'yes')) then
if player:getLevel() >= reblevel then
player:doRebirth()
player:remove()
else
selfSay('Come back when your level is '..reblevel..'.')
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())