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

Lua Train system for 0.2+ ask

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if not isPremium(cid) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUNEEDPREMIUMACCOUNT)
		return true
	end


	if isPlayerPzLocked(cid) then
		return false
	end


	if item.itemid == 18492 then
		doPlayerSetOfflineTrainingSkill(cid, SKILL_MAGLEVEL)
	elseif item.itemid == 18491 then
		doPlayerSetOfflineTrainingSkill(cid, SKILL_DISTANCE)
	elseif item.itemid == 18490 then
		doPlayerSetOfflineTrainingSkill(cid, SKILL_CLUB)
	elseif item.itemid == 18489 then
		doPlayerSetOfflineTrainingSkill(cid, SKILL_AXE)
	elseif item.itemid == 18488 then
		doPlayerSetOfflineTrainingSkill(cid, SKILL_SWORD)
	end


	doRemoveCreature(cid)
	return true
end
 
where would I put this in my ot? for it to work, like under what file?

actions folder

It works, I can click them and i go offline but my skills will not go up can someone please help and tell me why?

register the script this way
<action itemid="18488;18489;18490;18491;18492" event="script" value="filename.lua"/>

and make sure that u are using TFS 0.2/1.0
 
Im using TFS 0.2.14 but i switched around the format of the xml script so it should work :s

<action itemid="18488-18492" script="other/offlinetraining.lua"/>

and then i even tried making a seperate one for each

<action itemid="18488" script="other/offlinetraining.lua"/>
<action itemid="18489" script="other/offlinetraining2.lua"/>
 
use what I have posted pls

<action itemid="18488;18489;18490;18491;18492" event="script" value="other/offlinetraininglua"/>

number-number wont work :)
 
Use this:
<action fromid="18488" toid="18492" script="other/offlinetraining.lua" />

I'm not sure if 0.2.14 supported offline training though, but 0.2.15 definitely does.

Any other syntax (semicolons or dash) trying to register it in one line is a bad idea.
 
ok, if i download 0.2.15 the scripts i have in tfs 0.2.14 will work and everything ill still be able to use the 9.6 map i had, but is there a 9.6 0.2.15?
 
Yes, all your 0.2.14 scripts will work in 0.2.15.
Yes, your 9.6 map will work in 0.2.15.
No, the client version will be 9.80-9.86.
 
Back
Top