Forum

> > CS2D > Scripts > tibia add NPC
Forums overviewCS2D overview Scripts overviewLog in to reply

English tibia add NPC

2 replies
To the start Previous 1 Next To the start

moved tibia add NPC

DarkBooy
User Off Offline

Quote
cs2d sys lua cs2dtibia npc.lua >



my Question is :
> i want add NPC for teleport player lvl 40+ to other place.

NPC info :
[14] = {"Assissen",           pos={2452, 4787},      rot=0, image="npc2"},

and teleport to : pos={2337, 4921}

Admin/mod comment

Wrong section. Moved.

old Re: tibia add NPC

Yates
Reviewer Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
NPCs[14].func = function(npc,id,words,state)
	if words == "hi" then
		NPCspeak(npc,"Halt. You need to be level 40+ to pass. Want to go in?")
		PLAYERS[id].tmp.npcstate = {npc, 1}
	elseif contains(words,"bye") then
		NPCspeak(npc, "Hmff..")
		PLAYERS[id].tmp.npcstate = nil
	elseif state == 1 then
		if contains(words, "yes") then
			if PLAYERS[id].Level >= 40 then
				NPCspeak(npc, "Sure, go right ahead.")
				parse("setpos " .. id .. " 2337 4921")
				PLAYERS[id].tmp.npcstate = nil
			else
				NPCspeak(npc,"You're not a high enough level.")
			end
		elseif contains(words, "no") then
			NPCspeak(npc, "Not good enough eh? Come back later.")
			PLAYERS[id].tmp.npcstate = nil
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview