CS2D
Scripts NPC "Tibia Dungeon" erstellen NPC "Tibia Dungeon" erstellen
2 replies Hallo,
ich wollte bei dem Tibia/RPG script einen NPC erstellen der z.b wenn man in anspricht man wählen kann und dann z.b das lvl 5 dungeon wählt man soll dann dort hin teleportiert werden. Aber wenn man unter level 5 oder über level 10 ist wird man nicht teleportiert.
Wie kann man das machen kann einer eine Vorlage Posten.
Danke im vorraus.
MFg also hir habe ich was aber da mit lvl habe ich ka sry nur das:
[1] = {"HIR NAME EINGEBEN", pos={3248, 2640}, rot=180, image="npc4"},
[2] = {"HIR NAME EINGEBEN", pos={5008, 4720}, rot=180, image="npc4"},
[3] = {"HIR NAME EINGEBEN", pos={4400, 1008}, rot=180, image="npc4"},
dann unten:
NPCs[1].func = function(npc, id, words, state)
if words == "hi" then
NPCspeak(npc, "Welcome! Are you want to sail somewhere ?")
PLAYERS[id].tmp.npcstate = {npc, 1}
elseif state == 1 then
if words=="no" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "yes" then
NPCspeak(npc, "So where you want to sail:")
NPCspeak(npc, "[1] <- New island")
NPCspeak(npc, "[2] <- House island")
PLAYERS[id].tmp.npcstate = {npc, 2}
end
elseif state == 2 then
if words == "anywhere" or words == "nowhere" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "1" then
NPCspeak(npc, "So you want sail to new island.")
NPCspeak(npc, "It's cost only 100$.")
NPCspeak(npc, "Do you want sail ?")
PLAYERS[id].tmp.npcstate = {npc, 3}
elseif words == "2" then
NPCspeak(npc, "So you want sail to house island.")
NPCspeak(npc, "It's cost only 50$.")
NPCspeak(npc, "Do you want sail ?")
PLAYERS[id].tmp.npcstate = {npc, 4}
end
elseif state == 3 then
if words == "no" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "yes" then
if addmoney(id,-100) then
NPCspeak(npc, "Bon Voyage.")
parse('setpos '..id..' 4400 1040')
PLAYERS[id].tmp.npcstate = {npc, 0}
else
NPCspeak(npc, "You don't have enought money bye !")
PLAYERS[id].tmp.npcstate = {npc, 0}
end
end
elseif state == 4 then
if words == "no" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "yes" then
if addmoney(id,-50) then
NPCspeak(npc, "Bon Voyage.")
parse('setpos '..id..' 5008 4752')
PLAYERS[id].tmp.npcstate = {npc, 0}
else
NPCspeak(npc, "You don't have enought money bye !")
PLAYERS[id].tmp.npcstate = {npc, 0}
end
end
end
end
NPCs[2].func = function(npc, id, words, state)
if words == "hi" then
NPCspeak(npc, "Welcome! Are you want to sail somewhere ?")
PLAYERS[id].tmp.npcstate = {npc, 1}
elseif state == 1 then
if words=="no" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "yes" then
NPCspeak(npc, "So where you want to sail:")
NPCspeak(npc, "[1] <- Old island")
NPCspeak(npc, "[2] <- New island")
PLAYERS[id].tmp.npcstate = {npc, 2}
end
elseif state == 2 then
if words == "anywhere" or words == "nowhere" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "1" then
NPCspeak(npc, "So you want sail to old island.")
NPCspeak(npc, "It's cost only 50$.")
NPCspeak(npc, "Do you want sail ?")
PLAYERS[id].tmp.npcstate = {npc, 3}
elseif words == "2" then
NPCspeak(npc, "So you want sail to new island.")
NPCspeak(npc, "It's cost only 50$.")
NPCspeak(npc, "Do you want sail ?")
PLAYERS[id].tmp.npcstate = {npc, 4}
end
elseif state == 3 then
if words == "no" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "yes" then
if addmoney(id,-50) then
NPCspeak(npc, "Bon Voyage.")
parse('setpos '..id..' 3248 2672')
PLAYERS[id].tmp.npcstate = {npc, 0}
else
NPCspeak(npc, "You don't have enought money bye !")
PLAYERS[id].tmp.npcstate = {npc, 0}
end
end
elseif state == 4 then
if words == "no" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "yes" then
if addmoney(id,-50) then
NPCspeak(npc, "Bon Voyage.")
parse('setpos '..id..' 4400 1040')
PLAYERS[id].tmp.npcstate = {npc, 0}
else
NPCspeak(npc, "You don't have enought money bye !")
PLAYERS[id].tmp.npcstate = {npc, 0}
end
end
end
end
NPCs[3].func = function(npc, id, words, state)
if words == "hi" then
NPCspeak(npc, "Welcome! Are you want to sail somewhere ?")
PLAYERS[id].tmp.npcstate = {npc, 1}
elseif state == 1 then
if words=="no" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "yes" then
NPCspeak(npc, "So where you want to sail:")
NPCspeak(npc, "[1] <- Old island")
NPCspeak(npc, "[2] <- House island")
PLAYERS[id].tmp.npcstate = {npc, 2}
end
elseif state == 2 then
if words == "anywhere" or words == "nowhere" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "1" then
NPCspeak(npc, "So you want sail to old island.")
NPCspeak(npc, "It's cost only 100$.")
NPCspeak(npc, "Do you want sail ?")
PLAYERS[id].tmp.npcstate = {npc, 3}
elseif words == "2" then
NPCspeak(npc, "So you want sail to house island.")
NPCspeak(npc, "It's cost only 50$.")
NPCspeak(npc, "Do you want sail ?")
PLAYERS[id].tmp.npcstate = {npc, 4}
end
elseif state == 3 then
if words == "no" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "yes" then
if addmoney(id,-100) then
NPCspeak(npc, "Bon Voyage.")
parse('setpos '..id..' 3248 2672')
PLAYERS[id].tmp.npcstate = {npc, 0}
else
NPCspeak(npc, "You don't have enought money bye !")
PLAYERS[id].tmp.npcstate = {npc, 0}
end
end
elseif state == 4 then
if words == "no" then
NPCspeak(npc, "Bye then.")
PLAYERS[id].tmp.npcstate = {npc, 0}
elseif words == "yes" then
if addmoney(id,-50) then
NPCspeak(npc, "Bon Voyage.")
parse('setpos '..id..' 5008 4752')
PLAYERS[id].tmp.npcstate = {npc, 0}
else
NPCspeak(npc, "You don't have enought money bye !")
PLAYERS[id].tmp.npcstate = {npc, 0}
end
end
end
end
Du willst was mit Metin2 machen oder? eine frage soll mit etwa das script helfen ? Dieses Script ist von anfang an bei der Lua drin -.- das mit dem teleporten und so das geht bei mir nur ich brauche das er nach Level oder Exp abfragt.