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

Offline Training Problem

poopsiedoodle

Gibe moni plos
Joined
Nov 23, 2011
Messages
2,457
Reaction score
585
Location
Georgia
So, I put the scripts for offline training (I got them here: offline training scripts) and after putting them in, I can't log in. There's some error in one of the scripts somewhere, because that's what caused this last time. I changed something, there was an error, and I couldn't log in. I undid it and I could log in. But, the problem is, I don't want to undo this, I want it to actually work.
 
NOPE.

ErrorAGAIN.jpg

Also gave me an error with this script on line 12:

Code:
-- Offline trainers by Hauni :] 
function onUse(cid, item, frompos, item2, topos)

local 		accid 		= 	getAccountNumberByPlayerName(getCreatureName(cid))
local 		name 		= 	getCreatureName(cid)
local       statueIDs          =  { [18492]=8, [18491]=SKILL_DISTANCE,[18490]=SKILL_CLUB, [18489]=SKILL_AXE,[18488]=SKILL_SWORD}

		if statueIDs[item.itemid] then
			 db.query("INSERT INTO offline_training (`account_id`,`name`,`start_training`,`type`) VALUES(".. accid ..",'".. name .."',".. os.time()..",'".. statueIDs[item.itemid] .." ');")
			 doRemoveCreature(cid)
    return
    end

- - - Updated - - -

Line 12 being where it says end.

blaherror.jpg here's the error with the script.
 
in the first error use
getOnlinePlayers()
instead
getPlayersOnline()

2º error
LUA:
-- Offline trainers by Hauni :] 
function onUse(cid, item, frompos, item2, topos)

local accid = getAccountNumberByPlayerName(getCreatureName(cid))
local name 	= getCreatureName(cid)
local statueIDs = {[18492]=8, [18491]=SKILL_DISTANCE,[18490]=SKILL_CLUB, [18489]=SKILL_AXE,[18488]=SKILL_SWORD}

	if statueIDs[item.itemid] then
		db.query("INSERT INTO offline_training (`account_id`,`name`,`start_training`,`type`) VALUES(".. accid ..",'".. name .."',".. os.time()..",'".. statueIDs[item.itemid] .." ');")
		doRemoveCreature(cid)
    end
return true
end
 
I also ran into the same problem got the same scripts.

Code:
[05/10/2012 06:26:24] Zirra has logged in.

[05/10/2012 06:26:24] Lua Script Error: [CreatureScript Interface] 
[05/10/2012 06:26:25] data/creaturescripts/scripts/login.lua:onLogin
[05/10/2012 06:26:25] data/creaturescripts/scripts/login.lua:35: attempt to call global 'doPlayerAddSpentMana' (a nil value)
[05/10/2012 06:26:25] stack traceback:
[05/10/2012 06:26:25] 	[C]: in function 'doPlayerAddSpentMana'
[05/10/2012 06:26:25] 	data/creaturescripts/scripts/login.lua:35: in function <data/creaturescripts/scripts/login.lua:1>
[05/10/2012 06:26:25] Zirra has logged out.
 
Back
Top