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

Vocation Chest

Brohemith

New Member
Joined
Nov 28, 2010
Messages
46
Reaction score
0
Location
United States of America
I was thinking of having boxes for vocations, its similar to an oracle but its not an npc.

Basically there would be 2 boxes and if you choose one you become a knight and teleport somewhere, and if you choose the other you can become a paladin and teleport elsewhere, if anyone could post a scripts i would defiantly Rep++!!

~Thanks In Advance :)
 
Use it as action, put unique id to your chest.
For Knight
Lua:
	  <action uniqueid="xxxx" script="voc_knight.lua" />

voc_knight.lua
Lua:
	function onUse(cid, item, fromPosition, itemEx, toPosition)
local storageValue = xxxx 
local teleportPos = {x=xxxx, y=xx, z=x} 
 
	if(getPlayerStorageValue(cid, storageValue) ~= 1) then
          doPlayerSendTextMessage(cid, 22, 'You have already chosen your vocation.')
		  		  setPlayerStorageValue(cid, storageValue)
		return TRUE
	end
	if(getPlayerStorageValue(cid, storageValue) == 1) then
		doTeleportThing(cid, teleportPos)
				  doPlayerSetVocation(cid,4)
           doSendMagicEffect(teleportPos,10)
		end
		return TRUE
	end

local toPos = {x=xxx, y=xx, z=x} -- edit where to get teleported

For paladin make second chest with another unique id and replace doPlayerSetVocation(cid,4) with doPlayerSetVocation(cid,3) and use another storage in local storageValue = xxxx
 
Last edited:
[01/08/2012 18:06:53] [Error - LuaScriptInterface::loadFile] cannot open data/actions/scripts/voc_knight.lua: No such file or directory
[01/08/2012 18:06:53] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/voc_knight.lua)
[01/08/2012 18:06:53] cannot open data/actions/scripts/voc_knight.lua: No such file or directory

Which i have the script of:

function onUse(cid, item, fromPosition, itemEx, toPosition)
local storageValue = 250000
local toPos = {x=1013, y=1010, z=6}


if(getPlayerStorageValue(cid, storageValue) ~= 1) then
doTeleportThing(cid, toPos)
doPlayerSetVocation(cid,4)
doSendMagicEffect(toPos,10)
return TRUE
end
if(getPlayerStorageValue(cid, storageValue) == 1) then
doPlayerSendTextMessage(cid, 22, 'You have already chosen your vocation.')
end
return TRUE
end
 
Back
Top