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

Solved NPC Script Error

Progenosis

Member
Joined
Sep 6, 2011
Messages
131
Reaction score
18
Error:
Code:
[21/11/2014 11:12:27] [Error - LuaScriptInterface::loadFile] data/npc/scripts/godoffirenpc.lua:5: function arguments expected near ':'
[21/11/2014 11:12:27] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/godoffirenpc.lua
[21/11/2014 11:12:27] data/npc/scripts/godoffirenpc.lua:5: function arguments expected near ':'

Script:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
function creatureSayCallback(cid, type, msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
--[[
REMEMBER TO SET YOUR STORAGE AS YOURSTORAGE!
]]--
local storage = 1337
local itemID = 8303
local itemName = "Fire Matter"
local itemAmount = 20
local teleport = {x=988, y=947, z=15}
if(msgcontains(msg, 'travel') or msgcontains(msg, 'teleport')) then
if(getPlayerStorageValue(cid, storage) == -1) then
npcHandler:say("No es comun que los guerreros lleguen a mi guarida, solo yo conozco el secreto de Vulccus, el dios del fuego? Podria compartir esos secretos y llevarte a la zona de Vulccus si tan solo pudieras conseguir para mi ".. itemAmount .." ".. itemName .."!", cid)
setPlayerStorageValue(cid, storage, 1)
elseif(getPlayerStorageValue(cid, storage) == 1) then
npcHandler:say("A caso has logrado reunir ".. itemAmount .." ".. itemName .."?", cid)
talkState[talkUser] = 1
elseif(getPlayerStorageValue(cid, storage) == 2) then
npcHandler:say("Te gustaria que te lleve a la zona del Dios Vulccus? Solo te cobrare 5 cristal coins", cid)
talkState[talkUser] = 2
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if(doPlayerRemoveItem(cid, itemID, itemAmount)) then
npcHandler:say("La decision ha sido tuya, te llevare con el Dios Vulccus y enfrenta su furia!!", cid)
setPlayerStorageValue(cid, storage, 2)
doTeleportThing(cid, teleport)
talkState[talkUser] = 0
else
npcHandler:say("Veo que no puedes reunir todavia los 20 fire matter que te pedi, es una lastima!", cid)
talkState[talkUser] = 0
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
if doPlayerRemoveMoney(cid, 50000) == true then
doTelePortThing(cid, teleport)
else
npcHandler:say("Dije que te cobraria 5cc pero no los tienes, solo eres un pobre miserable!", cid)
talkState[talkUser] = 0
end
elseif(msgcontains(msg, 'no') and talkState[talkUser] > 0) then
npcHandler:say("Puedo notar en tu mirada el miedo que te da enfrentarte al Dios Vulccus, no te preocupes no te llevare a la fuerza con el.", cid)
talkState[talkUser] = 0
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Info:
Code:
TFS 0.3.6
Tibia Version 8.6

Help please!!
 
Change this
Code:
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
To this
Code:
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
This was changed because of missing code tags, which changed : o into a :eek: smiley, so if you find an npc script without code tags you have to change this.
 
It happens if you copy the script with those :eek: smileys :p
If I copy this

function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

It will look like this
Code:
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

It changes : o into : eek :
 
Back
Top