function onUse(cid, item, frompos, item2, topos)
storevalue = 37 --------------Where the time is stored
exhausttime = 600 --------------How long to stay inside in Seconds
outside = {x=500, y=1441, z=4} ------------------Where he should be teleported when time's out.
if item.itemid == 7038 or item.itemid == 7047 then
if item.actionid == 1300 then
if (exhaust(cid, storevalue, exhausttime) == 1) then
doSendMagicEffect(frompos, 12)
doPlayerSendTextMessage(cid, 20,"You have 10 minutes to train then you'll be teleported outside.") then
if(exhaust(cid, storevalue, exhausttime) == 1) then
doTeleportThing(cid,outside,0)
doPlayerSendCancel(cid,"You're done training.")
else
doPlayerSendCancel(cid,"Sorry, this ability costs 1500gp.")
end
end
end
return 1
end
end