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

Death Bug

tetra20

DD
Joined
Jan 17, 2009
Messages
1,316
Solutions
4
Reaction score
327
Location
Egypt
i need help please this is really important to me

i got a bug on my server when someone die

TFS 0.3.6 V8.2

dgdg.jpg

Thanks In Advance
 
seems like there is in a creaturescripts an onLogin event got a wrong configure or bad script not onDeath, try to find the script that include "ipairs" and post it here
 
Code:
--[[------------------------------------------------<|]
    |* * * * * * * * * * * * * * * * * * * * * * * * * * *| 
    |* * * * * * *  [SpellUp! Script] * * * * * * * * * * |
    |* * * * * * * * By: Cybermaster * * * * * * * * * * *|        
    |* * *  Tested on: The Forgotten Server 0.3.6pl1 * * *|
    |* * * * * * * * * * * * * * * * * * * * * * * * * * *|  
    |>---------------------------------------------------]]
 
local s = { --SETUP
    repeatAfterDeath = false, -- true -> player will always get the msg at lvlup | false -> player will only get the 1st time the gets the new level
    detailedInfo = true, -- true -> player will get name, words, mana & mana% info of spells | false -> player will only get the name and the words of the spells
-- storage below is where the newlevel will be stored ONLY IF YOU USE repeatAfterDeath
    Storage = 10000, 
    messageType = 'channel', -- options: 'popUp' or 'channel'
--this one below only used if messageType = channel
    channelClass = MESSAGE_EVENT_ORANGE  
    }
 
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill ~= SKILL__LEVEL or not s.repeatAfterDeath and getCreatureStorage(cid, s.Storage) >= newlevel then
        return true 
    end
 
    local t = {}
    for i = 0, getPlayerInstantSpellCount(cid) - 1 do
        local spell = getPlayerInstantSpellInfo(cid, i)
        if(spell.level ~= 0) and spell.level == newlevel then
            if(spell.manapercent > 0) then
                spell.mana = spell.manapercent .. '%'
            end
            table.insert(t, spell)
        end
    end
 
    table.sort(t, function(a, b) return a.level < b.level end)
    local text, prevLevel = '', -1
    for i, spell in ipairs(t) do
        local line = ''
        if(prevLevel ~= spell.level) then
            if(i ~= 1) then
                line = '\n'
            end
 
            line = line .. 'You have just advanced to level '..newlevel..' and learned new spells!\n'
            prevLevel = spell.level
        end
        text = text ..line..' ['..spell.name..'] "'..spell.words..'" '..(s.detailedInfo and 'Mana['..spell.mana..']'..(spell.mlevel > 0 and ' ML['..spell.mlevel..']' or '') or '')..'\n'
    end
 
    if text == '' then
        return true
    end
 
    doCreatureSetStorage(cid, s.Storage, newlevel)
    if s.messageType == 'popUp' then
        doShowTextDialog(cid, 2175, text)
    elseif s.messageType == 'channel' then
        doPlayerSendTextMessage(cid, s.channelClass, text)
    end
    return true
end
--[[---------------------------------------------------------------------------------------------------<|
|  * * * * * * * * * * * * * * * * * * * * * E N D * * * * * * * * * * * * * * * * * * * * * * * * * *  |   
|>=====================================================================================================]]

the only script got ipairs

thanks for Help all
 
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
	<config name="firstitems_config"><![CDATA[
		config = {
			storage = 30001,
			items = {2457, 2463, 2647, 2643, 2000, 2525, 2409, 2173, 2428, 2389, 2182, 2190, 2284}
		}
	]]></config>
	<event type="login" name="FirstItems" event="script"><![CDATA[
		domodlib('firstitems_config')

		function onLogin(cid)
			if(getPlayerStorageValue(cid, config.storage) > 0) then
				return true
			end

			for _, id in ipairs(config.items) do
				doPlayerAddItem(cid, id, 1)
			end
			
			setPlayerStorageValue(cid, config.storage, 1)
			return true
		end
	]]></event>
</mod>

and the fire storm event but i think the error isn't in fire storm
 
Replace
Code:
for _, id in ipairs(config.items) do
	doPlayerAddItem(cid, id, 1)
end
with
Code:
for i = 1, #config.items do
	doPlayerAddItem(cid, config.items[i], 1)
end
 
testing...

- - - Updated - - -

the error changed to

Capture.PNG

TY for help

- - - Updated - - -

FIXED... i fixed it myself ty guys for help
 
Back
Top