Jump to content
  • 0

Arrumar Uma Talkaction (Smiles)


tonynamoral

Question

Olá galera da Xtibia , eu tentei criar uma Script mas deu fail :"( Porém eu eu nao sei o erro ! vou postar o script para voces verem !

 

function onSay(words,param)
if (param == "!love") then
doSendMagicEffect(getThingPos(cid),51)
elseif (param == "!:@") then
doSendMagicEffect(getThingPos(cid),63)
elseif (param == "!") then
doSendMagicEffect(getThingPos(cid),70)
elseif (param == "!-.-") then
doSendMagicEffect(getThingPos(cid),71)
elseif (param == "!o.0") then
doSendMagicEffect(getThingPos(cid),72)
elseif (param == "!^^") then
doSendMagicEffect(getThingPos(cid),73)
elseif (param == "!:0") then
doSendMagicEffect(getThingPos(cid),74)
elseif (param == "!aff") then
doSendMagicEffect(getThingPos(cid),75)
elseif (param == "!:'(") then
doSendMagicEffect(getThingPos(cid),76)
end

 

Tag :

<talkaction words="!love;!:@;!;!-.-;!o.0;!^^;!;!aff;!:'(" event="script" value="smiles.lua"/>

 

Error do Console

[05/06/2012 16:01:30] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/smiles.lua:25: 'end' expected (to close 'function' at line 1) near '<eof>'
[05/06/2012 16:01:30] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/smiles.lua)
[05/06/2012 16:01:30] data/talkactions/scripts/smiles.lua:25: 'end' expected (to close 'function' at line 1) near '<eof>'

 

 

Agora outra script ,

local monsters = {
["Budge Dragon"] = {count = 100, cap = 200},
["Horse"]= {count = 100, cap = 200}
}
function onKill(cid, target, lastHit)
local tab = monsters[getCreatureName(target)]
if tab then
doPlayerAddItem(cid, tab.itemid, tab.count)
doPlayerSetMaxCapacity(cid, (getPlayerFreeCap(cid) + tab.cap)
doPlayerSendCancel(cid,"You Drop "..tab.count.." Zen.")
end
end
return true
end

 

Error do Console

[05/06/2012 16:01:30] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/itemcap.lua:11: ')' expected (to close '(' at line 10) near 'end'
[05/06/2012 16:01:30] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/itemcap.lua)
[05/06/2012 16:01:30] data/creaturescripts/scripts/itemcap.lua:11: ')' expected (to close '(' at line 10) near 'end'

 

Se Poderem me ajudar :)

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Ta ai:

function onSay(words,param)
if (param == "!love") then
doSendMagicEffect(getThingPos(cid),51)
elseif (param == "!:@") then
doSendMagicEffect(getThingPos(cid),63)
elseif (param == "!") then
doSendMagicEffect(getThingPos(cid),70)
elseif (param == "!-.-") then
doSendMagicEffect(getThingPos(cid),71)
elseif (param == "!o.0") then
doSendMagicEffect(getThingPos(cid),72)
elseif (param == "!^^") then
doSendMagicEffect(getThingPos(cid),73)
elseif (param == "!:0") then
doSendMagicEffect(getThingPos(cid),74)
elseif (param == "!aff") then
doSendMagicEffect(getThingPos(cid),75)
elseif (param == "!:'(") then
doSendMagicEffect(getThingPos(cid),76)
end
end

 

Este aqui tbm :

 

local monsters = {
["Budge Dragon"] = {count = 100, cap = 200},
["Horse"]= {count = 100, cap = 200}
}
function onKill(cid, target, lastHit)
local tab = monsters[getCreatureName(target)]
if tab then
doPlayerAddItem(cid, tab.itemid, tab.count)
doPlayerSetMaxCapacity(cid, (getPlayerFreeCap(cid) + tab.cap))
doPlayerSendCancel(cid,"You Drop "..tab.count.." Zen.")
end
end
return true
end

Edited by SmiX
Link to comment
Share on other sites

  • 0

Tinha outro erro esse foi concertado e testado.

local monsters = {

["Budge Dragon"] = {count = 100, cap = 200},

["Horse"]= {count = 100, cap = 200}

}

function onKill(cid, target, lastHit)

local tab = monsters[getCreatureName(target)]

if tab then

doPlayerAddItem(cid, tab.itemid, tab.count)

doPlayerSetMaxCapacity(cid, (getPlayerFreeCap(cid) + tab.cap))

doPlayerSendCancel(cid,"You Drop "..tab.count.." Zen.")

end

return true

end

Link to comment
Share on other sites

×
×
  • Create New...