• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Potrzebuje pomocy przy skrypcie.

witmar

New Member
Joined
Oct 21, 2008
Messages
248
Reaction score
0
Location
Poland, Dębica
Witam mam blad ze skryptem na teleporty do inq. Oto blad:
[Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/inquisition.lua:39: '<eof>' expected near 'function'
[Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/inquisition.lua)
data/creaturescripts/scripts/inquisition.lua:39: '<eof>' expected near 'function'

A oto skrypt:

local monsters =
{
["Ushuriel"] = {teleportPos = {x = 1100, y = 1214, z = 12, stackpos = 1}, toPos = {x = 1188, y = 1213, z = 12}},
["Annihilon"] = {teleportPos = {x = 1187, y = 1199, z = 12, stackpos = 1}, toPos = {x = 1193, y = 1255, z = 12}},
["Hellgorak"] = {teleportPos = {x = 1192, y = 1241, z = 12, stackpos = 1}, toPos = {x = 1113, y = 1253, z = 12}},
["Madareth"] = {teleportPos = {x = 1112, y = 1241, z = 12, stackpos = 1}, toPos = {x = 1130, y = 1214, z = 12}},
["Zugurosh"] = {teleportPos = {x = 1148, y = 1214, z = 12, stackpos = 1}, toPos = {x = 1148, y = 1253, z = 12}},
["Golgordan"] = {teleportPos = {x = 1147, y = 1245, z = 12}, toPos = {x = 1065, y = 1308, z = 13}}
}



local time = 180 --seconds(3 minutes)

function onKill(cid, target, lastHit)

if(monsters[getCreatureName(target)]) then
local t = monsters[getCreatureName(target)]
doCreateTeleport(1387, t.toPos, t.teleportPos)
doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear", TALKTYPE_MONSTER, getCreaturePosition(target))
addEvent(doRemoveTeleport, time * 1000, t.teleportPos)
elseif(brothers[getCreatureName(target)]) then
t = brothers[getCreatureName(target)]
local brother = getCreatureByName(t.brother)
if(isMonster(brother) == true) then
if(isInRange(getCreaturePosition(brother), brothers.brothersArea.fromPos, brothers.brothersArea.toPos) == true) then
return true
else
doCreateTeleport(1387, t.toPos, t.teleportPos)
doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
end
doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear", TALKTYPE_MONSTER, getCreaturePosition(target))
addEvent(doRemoveTeleport, time * 1000, t.teleportPos)
end
end
end
return true
function doRemoveTeleport(position)

if(getTileThingByPos(position).itemid > 0) then
doRemoveItem(getTileThingByPos(position).uid)
doSendMagicEffect(position, CONST_ME_POFF)
end
end

Prosze Was o pomoc. Rep++ za pomoc.
 
Last edited:
Zjadłes position w "function doRemoveTeleport(position)"

zmień:

end
end
return true

Na:

end
return true
end

jeśli nie zaczniesz używać wcięć żeby kod był jakkolwiek czytelny to raczej ludzie nie będą pomagać, domyślam się że kod jest tak nieczytelny ponieważ nie posiadasz żadnego edytora tekstowego i i robiłeś to w notatniku więc zacznij od zainstalowania notepad++.
 
masz w tym pełno syfu, po co szukasz czegoś w tablicy brothers która nie istnieje?
poza tym przenies funkcje usuwajaca PRZED funkcje ktora ja wywoluje
 
masz w tym pełno syfu, po co szukasz czegoś w tablicy brothers która nie istnieje?
poza tym przenies funkcje usuwajaca PRZED funkcje ktora ja wywoluje

probowalem edytowac skrypt z twojego tematu z dzialu ze skryptami ale jak "zabilem braci" wywalalo mi bledy wiec chcialem zrobic na wlasna reke ale jak widac nie pomoglo.
gdybys mogl dokladniej wyjasnic ocb z ta arena brothers, gdzie trzeba zaznaczyc obszar, i jak ;p
 
frompos to lewy gorny rog pokoju, topos prawy dolny rog.
w zasadzie powinienes zmieniac tylko pozycje, teksty iczas, chyba ze naprawde wiesz co robisz
w pierwszej wersji pos to miejsce gdzie pojawi sie tp, w drugiej to miejsce gdzie jest tp na mapie juz postawiony
jak cos jeszcze chcesz to pisz na msna
 
Wydaje mi się ze lepiej by było żebyś od nowa skopiował ten skrypt i jeszcze raz pozmieniał tak jak trzeba będzie szybciej i unikniesz błędów związanych z nieumiejętnym modyfikowaniem skryptu.

Zrób tak jak mów Zakius zmień pozycje czas i tekst i powinno działać i będzie wyglądało estetyczniej.
 
i pamiętaj o doCreatureSayWithDelay(link w oryginalnym temacie) inaczej nie bedzie dzialać tekst
 
blad :
[Error - CreatureScript Interface]
data/creaturescripts/scripts/inquisition3.lua:onKill
Description:
data/lib/032-position.lua:2: attempt to index global 'position' (a nil value)
stack traceback:
data/lib/032-position.lua:2: in function 'isInRange'
data/creaturescripts/scripts/inquisition3.lua:35: in function <data/creaturescripts/scripts/inquisition3.lua:23>
 
Last edited:
z tym sobie poradzilem trzeba bylo podmienic z
function isInRange(pos, fromPosition, toPosition)
na
function isInRange(position, fromPosition, toPosition)
ale nie pojawia sie tp po zabicu "braci"

moj caly skrypt:
local monsters =
{
["Ushuriel"] = {teleportPos = {x = 1100, y = 1214, z = 12, stackpos = 1}, toPos = {x = 1188, y = 1213, z = 12}},
["Annihilon"] = {teleportPos = {x = 1187, y = 1199, z = 12, stackpos = 1}, toPos = {x = 1193, y = 1255, z = 12}},
["Hellgorak"] = {teleportPos = {x = 1192, y = 1241, z = 12, stackpos = 1}, toPos = {x = 1113, y = 1253, z = 12}},
["Madareth"] = {teleportPos = {x = 1112, y = 1241, z = 12, stackpos = 1}, toPos = {x = 1130, y = 1214, z = 12}},
["Zugurosh"] = {teleportPos = {x = 1148, y = 1214, z = 12, stackpos = 1}, toPos = {x = 1148, y = 1253, z = 12}}
}

local brothers =
{
["Golgordan"] = {teleportPos = {x = 1147, y = 1245, z = 12}, toPos = {x = 1065, y = 1308, z = 13}, brother = "Latrivan"},
["Latrivan"] = {teleportPos = {x = 1147, y = 1245, z = 12}, toPos = {x = 1065, y = 1308, z = 13}, brother = "Golgordan"},

brothersArea =
{
fromPos = {x = 1139, y = 1244, z = 12},
toPos = {x = 1155, y = 1254, z = 12}
}
}
local time = 180 --seconds(3 minutes)

function onKill(cid, target, lastHit)

if(monsters[getCreatureName(target)]) then
local t = monsters[getCreatureName(target)]
doCreateTeleport(1387, t.toPos, t.teleportPos)
doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear", TALKTYPE_MONSTER, getCreaturePosition(target))
addEvent(doRemoveTeleport, time * 1000, t.teleportPos)
elseif(brothers[getCreatureName(target)]) then
t = brothers[getCreatureName(target)]
local brother = getCreatureByName(t.brother)
if(isMonster(brother) == true) then
if(isInRange(getCreaturePosition(brother), brothers.brothersArea.fromPos, brothers.brothersArea.toPos) == true) then
return true
else
doCreateTeleport(1387, t.toPos, t.teleportPos)
doSendMagicEffect(t.teleportPos, CONST_ME_POFF)
doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear", TALKTYPE_MONSTER, getCreaturePosition(target))
addEvent(doRemoveTeleport, time * 1000, t.teleportPos)
end
end
end
return true
end

function doRemoveTeleport(position)
if(getTileThingByPos(position).itemid > 0) then
doRemoveItem(getTileThingByPos(position).uid)
doSendMagicEffect(position, CONST_ME_POFF)
end
end
 
Back
Top