function onUse(cid, item, frompos, item2, topos)
if item.uid == 1313 and item.itemid == 1945 or item.itemid == 1946 then
nplayer1pos = {x=1687, y=1191, z=7}
doSendMagicEffect(player1pos,2)
doTeleportThing(cid,nplayer1pos)
doSendMagicEffect(nplayer1pos,10)
setPlayerStorageValue(cid, 11553, 1)
local timed = 15
local czas = 0
local function timer(i)
if(getPlayerStorageValue(cid, 11553)==1)then
xpos = {x=1000, y=1000, z=7}
end
doTeleportThing(i.cid, xpos)
doPlayerSendTextMessage(cid, 19, 'Twoj czas sie skonczyl!')
end
if(czas == 0)then
addEvent(timer, (timed*60000), {cid=cid, xpos=getThingfromPos(getPlayerPosition(cid))})
doPlayerSendTextMessage(cid, 19, 'You have 15 minutes :P(dalate this text if dont want it!')
czas = os.time()
end
if(os.time() <= (czas+timed*30))then
stopEvent(timer)
setPlayerStorageValue(cid, 11553, -1)
setPlayerStorageValue(cid, 11554, 1)
end
end
end