• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Simple NPC request

azzkaban

Monster Maker
Joined
Feb 23, 2010
Messages
1,101
Reaction score
195
Location
Iquique Chile
Hi! I need simple NPC script:
Example:

Player: Hi
NPC: Me despertaste! Eres un bobo [PLAYERNAME] y no te concedere tres deseos. Toma esta limosna para que te vayas en alfombra voladora.

...and NPC add 500 to 5000 GP random.

Can you help me?

REP MAS 001.png

- - - Updated - - -

Bump!
 
lol, just edit a npc file, is simple and easy.

LUA:
local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
 
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
 
local storage = 1234


function creatureSayCallback(cid, type, msg)
	if msgcontains(msg, "hi") and (not npcHandler:isFocused(cid)) then
		if getPlayerStorageValue(cid, storage) < 1 then
			npcHandler:say("Me despertaste! Eres un bobo " .. getPlayerName(cid) .. " y no te concedere tres deseos. Toma esta limosna para que te vayas en alfombra voladora.", cid, TRUE)		
			npcHandler:releaseFocus(cid)
			setPlayerStorageValue(cid, storage, 1)
			doPlayerAddMoney(cid, math.ceil(math.random(500, 5000)))
		elseif getPlayerStorageValue(cid, storage) == 1 then
			npcHandler:say("No hay tiempo para ti.", cid, TRUE)
			npcHandler:releaseFocus(cid)
		end
	elseif (not npcHandler:isFocused(cid)) then
		return false
	end
	return true
end
 
npcHandler:setCallback(CALLBACK_FAREWELL, creatureFarewell)
npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye then.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

edited with the npc.
 
Last edited:
Back
Top