@anywhere, outside of a function
should be at top or bottom
should be at top or bottom
and if a player dies and where he teleported?
temple = {x=498, y=541, z=9},
local function boom(pos, cid)
local v = getTileItemById(pos, t.bombID).uid
if isPlayer(cid) and isInRange(getThingPos(cid), t.from, t.to) then
setPlayerStorageValue(cid, t.storage.placed, getPlayerStorageValue(cid, t.storage.placed) - 1)
doCreatureSay(cid, t.text, TALKTYPE_ORANGE_2, false, nil, pos)
doSendMagicEffect(pos, t.effect)
local c = getTopCreature(pos).uid
if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
doSendMagicEffect(pos, CONST_ME_GIFT_WRAPS)
doTeleportThing(c, t.temple)
doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
local n1, n2 = getPlayerName(c), getPlayerName(cid)
doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
local a = getPlayersInRange({x=497, y=500, z=7}, 7, 5)
if #a < 2 then
doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
doPlayerAddLevel(a[1], 1)
doTeleportThing(a[1], t.temple)
doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
reset()
reset()
end
else
local b = getTileItemById(pos, t.blockID).uid
if b > 0 then
doSendMagicEffect(pos, CONST_ME_BLOCKHIT)
doRemoveItem(b)
local r = math.random(10)
if r < 4 then
doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
end
end
end
local N, E, W, S, l = 1, 1, 1, 1, getPlayerStorageValue(cid, t.storage.radius)
function loopDir(dir)
local _pos = {x=pos.x+(dir=="E" and E or dir=="W" and -W or 0), y=pos.y+(dir=="N" and -N or dir=="S" and S or 0), z=pos.z}
if queryTileAddThing(v, _pos, 4) == RETURNVALUE_NOERROR or getTileItemById(_pos, t.blockID).uid > 0 then
doSendMagicEffect(_pos, t.effect)
local c = getTopCreature(_pos).uid
if isPlayer(c) and isInRange(getThingPos(c), t.from, t.to) then
doSendMagicEffect(_pos, CONST_ME_GIFT_WRAPS)
doTeleportThing(c, t.temple)
doSendMagicEffect(t.temple, CONST_ME_MORTAREA)
local n1, n2 = getPlayerName(c), getPlayerName(cid)
doBroadcastMessage(n1==n2 and n1 .. " killed " .. (getPlayerSex(c) == 0 and "her" or "him") .. "self!" or n1 .. " was killed by " .. n2 .. "!", MESSAGE_STATUS_WARNING)
local a = getPlayersInRange({x=497, y=500, z=7}, 7, 5)
if #a < 2 then
doBroadcastMessage(getPlayerName(a[1]) .. " has won the match!", MESSAGE_STATUS_WARNING)
doPlayerAddLevel(a[1], 1)
doTeleportThing(a[1], t.temple)
doSendMagicEffect(t.temple, CONST_ME_FIREWORK_RED)
reset()
reset()
return "endgame"
end
else
local b = getTileItemById(_pos, t.blockID).uid
if b > 0 then
doSendMagicEffect(_pos, CONST_ME_BLOCKHIT)
doRemoveItem(b)
local r = math.random(10)
if r < 4 then
doCreateItem(r==1 and 8304 or r==2 and 8306 or r==3 and 8310, 1, _pos)
end
return false
end
end
elseif queryTileAddThing(v, _pos, 4) == 3 then
return false
end
return true
end
while N <= l do
local q = loopDir("N")
if q == "endgame" then
return doRemoveItem(v, 1)
elseif not q then
break
else
N = N + 1
end
end
while E <= l do
local q = loopDir("E")
if q == "endgame" then
return doRemoveItem(v, 1)
elseif not q then
break
else
E = E + 1
end
end
while W <= l do
local q = loopDir("W")
if q == "endgame" then
return doRemoveItem(v, 1)
elseif not q then
break
else
W = W + 1
end
end
while S <= l do
local q = loopDir("S")
if q == "endgame" then
return doRemoveItem(v, 1)
elseif not q then
break
else
S = S + 1
end
end
end
doRemoveItem(v, 1)
end
[Error - LuaScriptInterface::loadFile] data/talkactions/scripts/bomb.lua:21: '<eof>' expected near 'end'
[Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/bomb.lua)
data/talkactions/scripts/bomb.lua:21: '<eof>' expected near 'end'
and[Error - TalkAction Interface]
In a timer event caller from:
Data/talkactions/scripts/bomb.luanSay
Description;
<LuaDoRemoveItem> Item not found
What is the problem?[Error - TalkAction Interface]
Ina a timer event called from:
data/talkactions/scripts/bombs.luanSay
Description
<LuadDoTitleQueryAdd> Thing not found