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

Help npc

danvirus

New Member
Joined
Sep 30, 2009
Messages
6
Reaction score
0
mans, please i need create a npc that should sell levels for 30 crystal coins for example

Npc: Hi, i sell 1 level for 30 crystal coin, you want?

Player: Yes

Npc: take you level

Player: you advanced... 2 to level 3

this i need, please helpme
bye
 
I can make a talkaction for it, it's easier.. I suck with NPC LOL. I can make the NPC do it but idk how to make it take the money, I'm only using XML. I don't know how to do LUA NPCs.

Here's a talkaction for it.. It's easier so people wont have to run across town to buy a level.

Goto Data -> Talkactions -> Scripts -> buylevel. lua (You add buylevel.lua yourself).
Add this code into it.
Lua:
function onSay(cid, words, param)
		if doPlayerRemoveMoney(cid, 300000) == TRUE then
			doPlayerAddLevel(cid, 1)
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought one level for 300K")
		else
			doPlayerSendTextMessage(cid, 21, "You don't have 300k for this level.")
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		end
end
Now add this XML code into Talkactions.xml
PHP:
	<talkaction words="!buylevel" script="buylevel.lua"/>
You can change the "!buylevel"
Here's a screenshot :p Just for the hell of it
21myb74.jpg


P.S; I DON'T CARE FOR REP. You don't need to add any.
 
Last edited:
Back
Top