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

Windows Problem on globalevents and monster

Exactly

New Member
Joined
Jul 14, 2014
Messages
119
Reaction score
4
Hello, i use 3777 TFS 8.6 and have this comment

checkDeaths.lua
[Error - LuaInterface::loadFile] data/globalevents/scripts/checkDeaths.lua:34: 'end' expected (to close 'function' at line 10) near '<eof>'
[Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/checkDeaths.lua)
data/globalevents/scripts/checkDeaths.lua:34: 'end' expected (to close 'function' at line 10) near '<eof>'


Code:
local items = {2557}
 
local eventTopxyz = {x = 2319, y = 1739, z = 7, stackpos = 253}
local eventBottomxyz = {x = 2334, y = 1795, z = 7, stackpos = 253}
local eventPosition = eventTopxyz, eventBottomxyz
 
local outOfEvent = {x = 1000, y = 1000, z = 7}
local players = getThingfromPos(eventPosition)
 
function onThink(intravel)
if    getGlobalStorageValue(cid, rushEvent) == 1 then
if getGlobalStorageValue(cid, redDeaths) == 0 or getGlobalStorageValue(cid, blueDeaths) == 0 then
        for i, pid in ipairs(players) do
    if (isPlayer(players)) then
        setPlayerStorageValue(pid, rushPlayer, 0)
        doTeleportThing(pid, outOfEvent)
        doPlayerSetLossPercent(pid, 1, 100)
    if getPlayerStorageValue(pid, rushTeam) == 1 or 2 then
        setPlayerStorageValue(pid, rushTeam, 0)
    end
    if    getPlayerStorageValue(pid, rushPlayer) == 1 or 2 then
        setPlayerStorageValue(pid, rushPlayer, 0)
    end
    if getPlayerStorageValue(pid, rushWinner) then
        setPlayerStorageValue(pid, rushWinner, 0)
        doPlayerAddItem(pid, math.random(items), 1)
if math.random(item) == 1 then
 doPlayerAddItem(pid, items[1], 1)
end
end
end
end
end
end


And second problem on monster

Unknown attribute type - defense. (data/monster/new/Book of the Dead.xml)

Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Book of the dead" nameDescription="a book of the dead" race="undead" experience="70000" speed="0" manacost="0">
  <health now="100000" max="100000"/>
  <look typeex="8983"/>
  <targetchange interval="5000" chance="20"/>
  <strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="0"/>
    <flag canpushcreatures="1"/>
    <flag targetdistance="1"/>
    <flag staticattack="100"/>
    <flag runonhealth="0"/>
 </flags>
          <defense name="healing" interval="1000" chance="17" min="500" max="1000">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
  <immunities>
    <immunity physical="0"/>
    <immunity energy="1"/>
    <immunity poison="1"/>
    <immunity ice="1"/>
    <immunity death="1"/>
    <immunity lifedrain="1"/>
    <immunity manadrain="1"/>
    <immunity paralyze="1"/>
    <immunity outfit="1"/>
    <immunity invisible="1"/>
  </immunities>
  <summons maxSummons="13">
    <summon name="devil dragon" interval="3000" chance="100" max="20"/>
    <summon name="frez dragon" interval="2000" chance="29" max="15"/>
        <summon name="bone dragon" interval="2000" chance="29" max="18"/>
            <summon name="slime rider" interval="2000" chance="29" max="10"/>
                <summon name="slimon" interval="2000" chance="29" max="15"/>
                    <summon name="hive" interval="2000" chance="29" max="7"/>
  </summons>
</monster>

Thanks!!
 
I think you must stop copy and paste code without understading.
The first one is very disordered, and the error says you must add another "end".
Second one your TFS doesn't have attribute "defense" added.
 
1:
Code:
local items = {2557}

local eventTopxyz = {x = 2319, y = 1739, z = 7, stackpos = 253}
local eventBottomxyz = {x = 2334, y = 1795, z = 7, stackpos = 253}
local eventPosition = eventTopxyz, eventBottomxyz

local outOfEvent = {x = 1000, y = 1000, z = 7}
local players = getThingfromPos(eventPosition)

function onThink(intravel)
    if    getGlobalStorageValue(cid, rushEvent) == 1 then
        if getGlobalStorageValue(cid, redDeaths) == 0 or getGlobalStorageValue(cid, blueDeaths) == 0 then
            for i, pid in ipairs(players) do
                if (isPlayer(players)) then
                    setPlayerStorageValue(pid, rushPlayer, 0)
                    doTeleportThing(pid, outOfEvent)
                    doPlayerSetLossPercent(pid, 1, 100)
                    if getPlayerStorageValue(pid, rushTeam) == 1 or 2 then
                        setPlayerStorageValue(pid, rushTeam, 0)
                    end
                    if getPlayerStorageValue(pid, rushPlayer) == 1 or 2 then
                        setPlayerStorageValue(pid, rushPlayer, 0)
                    end
                    if getPlayerStorageValue(pid, rushWinner) then
                        setPlayerStorageValue(pid, rushWinner, 0)
                        doPlayerAddItem(pid, math.random(items), 1)
                        if math.random(item) == 1 then
                            doPlayerAddItem(pid, items[1], 1)
                        end
                    end
                end
            end
        end
    end
    return true
end
2:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Book of the dead" nameDescription="a book of the dead" race="undead" experience="70000" speed="0" manacost="0">
  <health now="100000" max="100000"/>
  <look typeex="8983"/>
  <targetchange interval="5000" chance="20"/>
  <strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="0"/>
    <flag canpushcreatures="1"/>
    <flag targetdistance="1"/>
    <flag staticattack="100"/>
    <flag runonhealth="0"/>
  </flags>
  <defenses>
    <defense name="healing" interval="1000" chance="17" min="500" max="1000">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
  </defenses>
  <immunities>
    <immunity physical="0"/>
    <immunity energy="1"/>
    <immunity poison="1"/>
    <immunity ice="1"/>
    <immunity death="1"/>
    <immunity lifedrain="1"/>
    <immunity manadrain="1"/>
    <immunity paralyze="1"/>
    <immunity outfit="1"/>
    <immunity invisible="1"/>
  </immunities>
  <summons maxSummons="13">
    <summon name="devil dragon" interval="3000" chance="100" max="20"/>
    <summon name="frez dragon" interval="2000" chance="29" max="15"/>
    <summon name="bone dragon" interval="2000" chance="29" max="18"/>
    <summon name="slime rider" interval="2000" chance="29" max="10"/>
    <summon name="slimon" interval="2000" chance="29" max="15"/>
    <summon name="hive" interval="2000" chance="29" max="7"/>
  </summons>
</monster>
 
Back
Top