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

Reported Post by J.Dre

Status
Not open for further replies.

J.Dre

Unity Games
Joined
May 18, 2011
Messages
2,643
Solutions
3
Reaction score
639
Location
United States
J.Dre has reported a post.

Reason:
This should be moved to open tibia support.
Post: NPC not working
Forum: Monsters, NPC & Raids
Assigned Moderators: Scarlet Ayleid

Posted by: Frillinde
Original Content:
I made an npc. It has error "'end' expected (to close 'if' at line 46) near 'else'"....I am not good with lua and realize that,...all I can see is maybe I need 13 ends????lol I have no clue.
:)
Anyhow NPC is
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Wallin" script="tutor1.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="160" head="95" body="94" legs="132" feet="118" addons="0"/> <parameters></parameters>
</npc>

and LUA is
local quest = 2005

if getPlayerStorageValue(cid, quest) == 0 then
doPlayerSendTextMessage(cid, 19, "May I help you with something?")
if msgcontains(msg, 'Tutor Quest')
then
doPlayerSendTextMessage(cid, 19, "Would you like to start the Tutor Quest?")
if msgcontains(msg, 'yes')
then
doPlayerSendTextMessage(cid, 19, "Ok then, You need to speak to Curtis in Ebanor to continue this quest.")
setPlayerStorageValue(cid, quest, 1)
else
if getPlayerStorageValue(cid, quest) == 1 then
doPlayerSendTextMessage(cid, 19, "You should go see Curtis in Ebanor to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 2 then
doPlayerSendTextMessage(cid, 19, "You should go see Brunelle in Duzanne to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 3 then
doPlayerSendTextMessage(cid, 19, "You should go see Gomar at the Southern Post to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 4 then
doPlayerSendTextMessage(cid, 19, "You should go see Braat in Tidus to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 5 then
doPlayerSendTextMessage(cid, 19, "You should go see Freesin in Rundan to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 6 then
doPlayerSendTextMessage(cid, 19, "You should go see Taldorian in Numbring to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 7 then
doPlayerSendTextMessage(cid, 19, "You should go see Fexnir on the Plains of Gormaak to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 8 then
doPlayerSendTextMessage(cid, 19, "You should go see Jolly in Kelbin to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 9 then
doPlayerSendTextMessage(cid, 19, "You should go see Poani at the Northern post to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 10 then
doPlayerSendTextMessage(cid, 19, "You should go see Te'Zethel on the Isle of Timarlane to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 11 then
doPlayerSendTextMessage(cid, 19, "You should go see Delbert in Bendro to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 12 then
doPlayerSendTextMessage(cid, 19, "You should go see Ferdelus in Roshka to continue this quest")
else
if getPlayerStorageValue(cid, quest) == 13 then
doPlayerSendTextMessage(cid, 19, "You should go see Gormel in Caldor to continue this quest")
end
if getPlayerGroupId(cid) > "1" then
doPlayerSendCancel(cid, "The life of a tutor can be hard at times...")
end
else
doPlayerSendTextMessage(cid, 19, "I'm sorry but I can't help you right now.")
end

Again,I know its probably not even close to being right but Im trying to teach myself the lua stuff.
If anyone is bored and wants to help me learn I'd really appreciate it .

:)
 
Status
Not open for further replies.
Back
Top