Ir para conteúdo

[Error - LuaInterface::loadFile] data/creaturescripts/scripts/login.lua:172: ' ' expected near 'end'

Featured Replies

Postado
local config = {
	loginMessage = getConfigValue('loginMessage')
}

	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin = getPlayerLastLoginSaved(cid)
		if(lastLogin > 0) then
	    local text = "- Comandos uteis em nosso servidor:\n ------------------------------\n!aol               -> Comprar AOL, 10k.\n!bless           -> Comprar Bless, 100k. \n!frags          -> Ver quantidade de Frags.\n!explorer   -> Comprar rope e shovel por 500gps.\n!tpnoob       -> Teletransportar level 50- ao templo.\nCtrl+R         -> Reporte os bugs a nossa equipe ou \n- Visite tambem nossa pagina: www.elysium-ats.com."
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text)
		else
			doPlayerSendOutfitWindow(cid)
		end

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
		elseif(accountManager == MANAGER_NAMELOCK) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
		elseif(accountManager == MANAGER_ACCOUNT) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end



    --- REGISTRO DE EVENTO ---
		registerCreatureEvent(cid, "IOE")
		registerCreatureEvent(cid, "Mail")
		registerCreatureEvent(cid, "deathchannel")
		registerCreatureEvent(cid, "WarKill")


		registerCreatureEvent(cid, "gv1")
		registerCreatureEvent(cid, "gv2")
		registerCreatureEvent(cid, "gv3")
		registerCreatureEvent(cid, "ga1")
		registerCreatureEvent(cid, "ga2")
		registerCreatureEvent(cid, "ga3")
		registerCreatureEvent(cid, "Idle")

		registerCreatureEvent(cid, "gate")
		registerCreatureEvent(cid, "death_king")
		registerCreatureEvent(cid, "king")
		registerCreatureEvent(cid, "player_combat")
		registerCreatureEvent(cid, "king_sinc")
		registerCreatureEvent(cid, "player_death_dtk")

		registerCreatureEvent(cid, "CityWar")
		registerCreatureEvent(cid, "DeathBroadCast")
		registerCreatureEvent(cid, "Idle")
		registerCreatureEvent(cid, "WarAttack")
		registerCreatureEvent(cid, "GuildMotd")
		registerCreatureEvent(cid, "ChangeName")
		registerCreatureEvent(cid, "antiacc")
		registerCreatureEvent(cid, "PlayerAdvance")
		registerCreatureEvent(cid, "bonusvip")
		registerCreatureEvent(cid, "ExpVip")
		registerCreatureEvent(cid, "parceria")
		registerCreatureEvent(cid, "parceria_look")
		registerCreatureEvent(cid, "BountyHunter")
		registerCreatureEvent(cid, "onPrepareDeath")
		registerCreatureEvent(cid, "reward")
		registerCreatureEvent(cid, "SkullCheck")
		registerCreatureEvent(cid, "ReportBug")
		registerCreatureEvent(cid, "Castle")
		registerCreatureEvent(cid, "welcome")
		registerCreatureEvent(cid, "KillingInTheNameOf")
		registerCreatureEvent(cid, "ArenaKill")
		registerCreatureEvent(cid, "TiraBattle")
		registerCreatureEvent(cid, "rewardkill")
		registerCreatureEvent(cid, "AdvanceReward")
	--- REGISTRO DE EVENTO ---



local guild, enemy, guildFrags, enemyFrags = getPlayerGuildId(cid)
local fightingGuilds = {}
local tmp = db.getResult("SELECT `guild_id`, `enemy_id`, `guild_kills`, `enemy_kills`, `frags` FROM `guild_wars` WHERE `guild_id` = "..guild.." OR `enemy_id` = "..guild.." AND `status` = 1;")
if tmp:getID() ~= -1 then
	i = 1
	repeat
		if tmp:getDataInt("guild_id") == guild then
			enemy = tmp:getDataInt("enemy_id")
			guildFrags = tmp:getDataInt("guild_kills")
			enemyFrags = tmp:getDataInt("enemy_kills")
		else
			enemy = tmp:getDataInt("guild_id")
			guildFrags = tmp:getDataInt("enemy_kills")
			enemyFrags = tmp:getDataInt("guild_kills")
		end
		local enemyName, _tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy)
		if(_tmp:getID() ~= -1) then
			enemyName = _tmp:getDataString("name")
			_tmp:free()

		end

		fightingGuilds[i] = {}
		fightingGuilds[i].name = enemyName
		fightingGuilds[i].guildFrags = guildFrags
		fightingGuilds[i].enemyFrags = enemyFrags
		fightingGuilds[i].limit = tmp:getDataInt("frags")

		i = i + 1
	until not(tmp:next())
	tmp:free()

	table.sort(fightingGuilds, function (a, b)
		return (a.name < b.name)
	end)

	local warString

	for k, v in pairs(fightingGuilds) do
		if not warString then
			warString = "Your guild is currently in war with the " .. v.name .. " (" .. v.guildFrags .. ":" .. v.enemyFrags .. " frags, limit ".. v.limit ..")"
		else
			warString = warString .. " and with the " .. v.name .. " (" .. v.guildFrags .. ":" .. v.enemyFrags.." frags, limit ".. v.limit .. ")"
		end
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, warString .. ".")
end

	 if getPlayerStorageValue(cid, 48902) < 1 then
      setPlayerStorageValue(cid, 48902, 0)
    end

	 if getPlayerStorageValue(cid, 48903) < 1 then
      setPlayerStorageValue(cid, 48903, 0)
    end

	
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0)
    end
		
    setPlayerStorageValue(cid, 42350, 0)
    setPlayerStorageValue(cid, 42352, 0) 

	return true
end

 

Estou enfrentando o seguinte problema em minha distro:

Loading creaturescripts... [Error - LuaInterface::loadFile] data/creaturescripts/scripts/login.lua:172: ' ' expected near 'end'

[Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/login.lua) data/creaturescripts/scripts/login.lua:172: ' ' expected near 'end' 

Não sei o que fazer, alguem consegue descobrir?  

Edit1: ele fala que está esperando '  ' antes do último END

Editado por Eduardo Perez (veja o histórico de edições)

Postado

está faltando a função main...

 

local config = {
	loginMessage = getConfigValue('loginMessage')
}
	function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin = getPlayerLastLoginSaved(cid)
		if(lastLogin > 0) then
	    local text = "- Comandos uteis em nosso servidor:\n ------------------------------\n!aol               -> Comprar AOL, 10k.\n!bless           -> Comprar Bless, 100k. \n!frags          -> Ver quantidade de Frags.\n!explorer   -> Comprar rope e shovel por 500gps.\n!tpnoob       -> Teletransportar level 50- ao templo.\nCtrl+R         -> Reporte os bugs a nossa equipe ou \n- Visite tambem nossa pagina: www.elysium-ats.com."
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text)
		else
			doPlayerSendOutfitWindow(cid)
		end

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
		elseif(accountManager == MANAGER_NAMELOCK) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
		elseif(accountManager == MANAGER_ACCOUNT) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end



    --- REGISTRO DE EVENTO ---
		registerCreatureEvent(cid, "IOE")
		registerCreatureEvent(cid, "Mail")
		registerCreatureEvent(cid, "deathchannel")
		registerCreatureEvent(cid, "WarKill")


		registerCreatureEvent(cid, "gv1")
		registerCreatureEvent(cid, "gv2")
		registerCreatureEvent(cid, "gv3")
		registerCreatureEvent(cid, "ga1")
		registerCreatureEvent(cid, "ga2")
		registerCreatureEvent(cid, "ga3")
		registerCreatureEvent(cid, "Idle")

		registerCreatureEvent(cid, "gate")
		registerCreatureEvent(cid, "death_king")
		registerCreatureEvent(cid, "king")
		registerCreatureEvent(cid, "player_combat")
		registerCreatureEvent(cid, "king_sinc")
		registerCreatureEvent(cid, "player_death_dtk")

		registerCreatureEvent(cid, "CityWar")
		registerCreatureEvent(cid, "DeathBroadCast")
		registerCreatureEvent(cid, "Idle")
		registerCreatureEvent(cid, "WarAttack")
		registerCreatureEvent(cid, "GuildMotd")
		registerCreatureEvent(cid, "ChangeName")
		registerCreatureEvent(cid, "antiacc")
		registerCreatureEvent(cid, "PlayerAdvance")
		registerCreatureEvent(cid, "bonusvip")
		registerCreatureEvent(cid, "ExpVip")
		registerCreatureEvent(cid, "parceria")
		registerCreatureEvent(cid, "parceria_look")
		registerCreatureEvent(cid, "BountyHunter")
		registerCreatureEvent(cid, "onPrepareDeath")
		registerCreatureEvent(cid, "reward")
		registerCreatureEvent(cid, "SkullCheck")
		registerCreatureEvent(cid, "ReportBug")
		registerCreatureEvent(cid, "Castle")
		registerCreatureEvent(cid, "welcome")
		registerCreatureEvent(cid, "KillingInTheNameOf")
		registerCreatureEvent(cid, "ArenaKill")
		registerCreatureEvent(cid, "TiraBattle")
		registerCreatureEvent(cid, "rewardkill")
		registerCreatureEvent(cid, "AdvanceReward")
	--- REGISTRO DE EVENTO ---



local guild, enemy, guildFrags, enemyFrags = getPlayerGuildId(cid)
local fightingGuilds = {}
local tmp = db.getResult("SELECT `guild_id`, `enemy_id`, `guild_kills`, `enemy_kills`, `frags` FROM `guild_wars` WHERE `guild_id` = "..guild.." OR `enemy_id` = "..guild.." AND `status` = 1;")
if tmp:getID() ~= -1 then
	i = 1
	repeat
		if tmp:getDataInt("guild_id") == guild then
			enemy = tmp:getDataInt("enemy_id")
			guildFrags = tmp:getDataInt("guild_kills")
			enemyFrags = tmp:getDataInt("enemy_kills")
		else
			enemy = tmp:getDataInt("guild_id")
			guildFrags = tmp:getDataInt("enemy_kills")
			enemyFrags = tmp:getDataInt("guild_kills")
		end
		local enemyName, _tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy)
		if(_tmp:getID() ~= -1) then
			enemyName = _tmp:getDataString("name")
			_tmp:free()

		end

		fightingGuilds[i] = {}
		fightingGuilds[i].name = enemyName
		fightingGuilds[i].guildFrags = guildFrags
		fightingGuilds[i].enemyFrags = enemyFrags
		fightingGuilds[i].limit = tmp:getDataInt("frags")

		i = i + 1
	until not(tmp:next())
	tmp:free()

	table.sort(fightingGuilds, function (a, b)
		return (a.name < b.name)
	end)

	local warString

	for k, v in pairs(fightingGuilds) do
		if not warString then
			warString = "Your guild is currently in war with the " .. v.name .. " (" .. v.guildFrags .. ":" .. v.enemyFrags .. " frags, limit ".. v.limit ..")"
		else
			warString = warString .. " and with the " .. v.name .. " (" .. v.guildFrags .. ":" .. v.enemyFrags.." frags, limit ".. v.limit .. ")"
		end
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, warString .. ".")
end

	 if getPlayerStorageValue(cid, 48902) < 1 then
      setPlayerStorageValue(cid, 48902, 0)
    end

	 if getPlayerStorageValue(cid, 48903) < 1 then
      setPlayerStorageValue(cid, 48903, 0)
    end

	
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0)
    end
		
    setPlayerStorageValue(cid, 42350, 0)
    setPlayerStorageValue(cid, 42352, 0) 

	return true
end

 

  • 10 months later...
Postado
Em 06/01/2017 em 16:10, Vodkart disse:

está faltando a função main...

 


local config = {
	loginMessage = getConfigValue('loginMessage')
}
	function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin = getPlayerLastLoginSaved(cid)
		if(lastLogin > 0) then
	    local text = "- Comandos uteis em nosso servidor:\n ------------------------------\n!aol               -> Comprar AOL, 10k.\n!bless           -> Comprar Bless, 100k. \n!frags          -> Ver quantidade de Frags.\n!explorer   -> Comprar rope e shovel por 500gps.\n!tpnoob       -> Teletransportar level 50- ao templo.\nCtrl+R         -> Reporte os bugs a nossa equipe ou \n- Visite tambem nossa pagina: www.elysium-ats.com."
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text)
		else
			doPlayerSendOutfitWindow(cid)
		end

			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
		elseif(accountManager == MANAGER_NAMELOCK) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
		elseif(accountManager == MANAGER_ACCOUNT) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end



    --- REGISTRO DE EVENTO ---
		registerCreatureEvent(cid, "IOE")
		registerCreatureEvent(cid, "Mail")
		registerCreatureEvent(cid, "deathchannel")
		registerCreatureEvent(cid, "WarKill")


		registerCreatureEvent(cid, "gv1")
		registerCreatureEvent(cid, "gv2")
		registerCreatureEvent(cid, "gv3")
		registerCreatureEvent(cid, "ga1")
		registerCreatureEvent(cid, "ga2")
		registerCreatureEvent(cid, "ga3")
		registerCreatureEvent(cid, "Idle")

		registerCreatureEvent(cid, "gate")
		registerCreatureEvent(cid, "death_king")
		registerCreatureEvent(cid, "king")
		registerCreatureEvent(cid, "player_combat")
		registerCreatureEvent(cid, "king_sinc")
		registerCreatureEvent(cid, "player_death_dtk")

		registerCreatureEvent(cid, "CityWar")
		registerCreatureEvent(cid, "DeathBroadCast")
		registerCreatureEvent(cid, "Idle")
		registerCreatureEvent(cid, "WarAttack")
		registerCreatureEvent(cid, "GuildMotd")
		registerCreatureEvent(cid, "ChangeName")
		registerCreatureEvent(cid, "antiacc")
		registerCreatureEvent(cid, "PlayerAdvance")
		registerCreatureEvent(cid, "bonusvip")
		registerCreatureEvent(cid, "ExpVip")
		registerCreatureEvent(cid, "parceria")
		registerCreatureEvent(cid, "parceria_look")
		registerCreatureEvent(cid, "BountyHunter")
		registerCreatureEvent(cid, "onPrepareDeath")
		registerCreatureEvent(cid, "reward")
		registerCreatureEvent(cid, "SkullCheck")
		registerCreatureEvent(cid, "ReportBug")
		registerCreatureEvent(cid, "Castle")
		registerCreatureEvent(cid, "welcome")
		registerCreatureEvent(cid, "KillingInTheNameOf")
		registerCreatureEvent(cid, "ArenaKill")
		registerCreatureEvent(cid, "TiraBattle")
		registerCreatureEvent(cid, "rewardkill")
		registerCreatureEvent(cid, "AdvanceReward")
	--- REGISTRO DE EVENTO ---



local guild, enemy, guildFrags, enemyFrags = getPlayerGuildId(cid)
local fightingGuilds = {}
local tmp = db.getResult("SELECT `guild_id`, `enemy_id`, `guild_kills`, `enemy_kills`, `frags` FROM `guild_wars` WHERE `guild_id` = "..guild.." OR `enemy_id` = "..guild.." AND `status` = 1;")
if tmp:getID() ~= -1 then
	i = 1
	repeat
		if tmp:getDataInt("guild_id") == guild then
			enemy = tmp:getDataInt("enemy_id")
			guildFrags = tmp:getDataInt("guild_kills")
			enemyFrags = tmp:getDataInt("enemy_kills")
		else
			enemy = tmp:getDataInt("guild_id")
			guildFrags = tmp:getDataInt("enemy_kills")
			enemyFrags = tmp:getDataInt("guild_kills")
		end
		local enemyName, _tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy)
		if(_tmp:getID() ~= -1) then
			enemyName = _tmp:getDataString("name")
			_tmp:free()

		end

		fightingGuilds[i] = {}
		fightingGuilds[i].name = enemyName
		fightingGuilds[i].guildFrags = guildFrags
		fightingGuilds[i].enemyFrags = enemyFrags
		fightingGuilds[i].limit = tmp:getDataInt("frags")

		i = i + 1
	until not(tmp:next())
	tmp:free()

	table.sort(fightingGuilds, function (a, b)
		return (a.name < b.name)
	end)

	local warString

	for k, v in pairs(fightingGuilds) do
		if not warString then
			warString = "Your guild is currently in war with the " .. v.name .. " (" .. v.guildFrags .. ":" .. v.enemyFrags .. " frags, limit ".. v.limit ..")"
		else
			warString = warString .. " and with the " .. v.name .. " (" .. v.guildFrags .. ":" .. v.enemyFrags.." frags, limit ".. v.limit .. ")"
		end
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, warString .. ".")
end

	 if getPlayerStorageValue(cid, 48902) < 1 then
      setPlayerStorageValue(cid, 48902, 0)
    end

	 if getPlayerStorageValue(cid, 48903) < 1 then
      setPlayerStorageValue(cid, 48903, 0)
    end

	
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0)
    end
		
    setPlayerStorageValue(cid, 42350, 0)
    setPlayerStorageValue(cid, 42352, 0) 

	return true
end

 

vc mudou oq ai cara? to com esse mesmo problema, socorro

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo