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

[REQUEST] premium npc.

Walking Hell

Fast Attack hoster
Joined
Jan 23, 2008
Messages
61
Reaction score
0
well, i can't find a npc/script that sells pacc days,
only a npc that sell promotion..

thanks in advanced.:thumbup:
 
Edit
Code:
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 addPremium(cid, message, keywords, parameters, node)
	if(cid ~= npcHandler.focus) then
		return false
	end
	
	local cost = parameters.cost
	id = parameters.id
		      if doPlayerRemoveMoney(cid, cost) == TRUE then
			doPlayerAddPremiumDays(cid, days)
			npcHandler:say('Great!')
		else
	end

	keywordHandler:moveUp(1)
	return true
end

local node = keywordHandler:addKeyword({'premium'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Are you sure?'})
	node:addChildKeyword({'yes'}, addPremium, {cost = 7000, days = 7})
	node:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Maybe next time.'})

keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can add you premmy days for money. I can add you 7 days premium for 7 k.'})

npcHandler:addModule(FocusModule:new())

Script for npc ;)
 
Last edited:
Back
Top