Ir para conteúdo

Featured Replies

Postado

Estou tentando configurar o Off Trainer mas me vem esse erro:

 

[Error - Test Interface]
data/creaturescripts/scripts/login.lua
Description:
(luaGetCreatureName) Creature not found

[Error - Test Interface]
data/creaturescripts/scripts/login.lua
Description:
data/creaturescripts/scripts/login.lua:66: attempt to concatenate global 'name' (a nil value)
[Error - Event::checkScript] Cannot load script (data/creaturescripts/scripts/login.lua)

Codigo:

	-- CONFIG
local       secondsPerHit       = 	2 			-- THE ATTACKSPEED (1 hit per 2 seconds; default) 
local       manaGenPerSec       =   10 			-- MANA USED PER SEC
local       offlineModifier     =   0.5 		-- FROM 0-1 (or higher if you wish). How fast you are skillin on offline training compared to normal (0.5 = 50%)
local 		maxSecondsTraining  =   60 * 60 * 12 -- (Default 12 hours)
--END of config

local 		accid 				= 	getAccountNumberByPlayerName(getCreatureName(cid))
local 		name 				= 	getCreatureName(cid)
local 		checkTraining 		=   db.storeQuery("SELECT * FROM offline_training WHERE `account_id`=".. accid .." AND `name`='".. name .."';")
local skills 					=   {[8]=MAGIC, [4]=SKILL_DISTANCE,[1]=SKILL_CLUB, [3]=SKILL_AXE,[2]=SKILL_SWORD}
local skillNames 					=   {[8]="Magic Level", [4]="Distance Fighting",[1]="Club Fighting", [3]="AxeFighting",[2]="Sword Fighting"}

	if checkTraining then
	
		local skill							 = 	 result.getDataInt(checkTraining, "type")
		local timeTrained					 = 	 result.getDataInt(checkTraining, "start_training")
		local secondsTrained 				 = 	 os.time()-timeTrained 
		local skillTries       				 =   math.floor((secondsTrained/secondsPerHit)*offlineModifier)
		local skillBefore
		local skillAfter
		
		if timeTrained > maxSecondsTraining then
		timeTrained = maxSecondsTraining 
		end
		
		if skill ~= 8 then
		skillBefore 						 = 	 getPlayerSkillLevel(cid, skills[skill])	
		doPlayerAddSkillTry(cid, skills[skill], skillTries)
		skillAfter		  	        		 =   getPlayerSkillLevel(cid, skills[skill])
		else
		skillBefore 						 = getPlayerMagLevel(cid)
		doPlayerAddSpentMana(cid, manaGenPerSec*secondsTrained)
		skillAfter					         = getPlayerMagLevel(cid)
		end
		
		
		local skillBeforeShield      		 =   getPlayerSkillLevel(cid, 5)
		doPlayerAddSkillTry(cid, 5, skillTries)
		local skillAfterShield		  	   	 =   getPlayerSkillLevel(cid, 5)


		
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your ".. skillNames[skill] .." skill changed from level ".. skillBefore.."  to level ".. skillAfter ..".")
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Your Shielding skill changed from level ".. skillBeforeShield.."  to level ".. skillAfterShield ..". ")

		db.query("DELETE FROM offline_training WHERE `account_id`=".. accid .." AND `name`='".. name .."';")
			
	end

Alguem poderia me ajudar?

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