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

8.54! Time Quest! Problem!

johny5608

johny
Joined
Oct 5, 2008
Messages
120
Reaction score
0
Location
Wien
Have got problem with this script!

--Script by Karpio
--Script version: 3.0
function onUse(cid, item, fromPosition, itemEx, toPosition)
--Konfiguracja
local config = {
uid = xxxx, --Uniqueid drzwi
ile = 10, --ile osob moze byc za drzwiami
gdzie = "dol", --w ktora strone przechodzi gracz
dir = {["lewo"] = 1, ["prawo"] = 3, ["gora"] = 2, ["dol"] = 0}, --Nie ruszamy
czas = xxxx, --Po ilu sekundach nas wyrzuci
dokad = getCreaturePosition(cid), --Nie ruszamy
item = getThingPos(item.uid) -- nie ruszamy
}
--//Konfiguracja
if(item.uid == config.uid) then
if(item.actionid == (config.ile + 100)) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only ".. config.ile .." people may be behind doors at the same time.")
return TRUE
end
if(getDirectionTo(getCreaturePosition(cid), toPosition) == config.dir[config.gdzie]) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You may not get back up to "..timeString(config.czas)..".")
return TRUE
end
if(item.actionid == 0) then
doItemSetAttribute(item.uid, "aid",101)
else
doItemSetAttribute(item.uid, "aid" + 1)
end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
zacznijCzekac(function()
czekaj(300)
if(config.gdzie == "lewo") then
doMoveCreature(cid, 3)
elseif(config.gdzie == "prawo") then
doMoveCreature(cid, 1)
elseif(config.gdzie == "gora") then
doMoveCreature(cid, 0)
elseif(config.gdzie == "dol") then
doMoveCreature(cid, 2)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have "..timeString(config.czas)..".")
if(config.czas > 60) then
czekaj((config.czas - 60) * 1000)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have only one minute.")
czekaj(60 * 1000)
local item = getThingFromPos(config.item)
doTeleportThing(cid, config.dokad)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The end of time.")
doSendMagicEffect(config.dokad, 10)
doSetItemActionId(item.uid, item.actionid - 1)
return TRUE
end
czekaj(config.czas * 1000)
local item = getThingFromPos(config.item)
doTeleportThing(cid, config.dokad)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The end of time.")
doSendMagicEffect(config.dokad, 10)
doSetItemActionId(item.uid, item.actionid - 1)
return TRUE
end)
return TRUE
end
return TRUE
end

When i first enter the Time door then i works but when i enter secondary than it don't work i can enter the door but the Time not start! and when i remove and create again the door and set Uid then it works at first time but second it comet that same! it not start the timer!
Please Help
 
[07/12/2010 20:03:49] [Error - Action Interface]
[07/12/2010 20:03:49] data/actions/scripts/timequest.lua:eek:nUse
[07/12/2010 20:03:49] Description:
[07/12/2010 20:03:49] data/actions/scripts/timequest.lua:27: attempt to perform arithmetic on a string value
[07/12/2010 20:03:49] stack traceback:
[07/12/2010 20:03:49] data/actions/scripts/timequest.lua:27: in function <data/actions/scripts/timequest.lua:3>
 
Back
Top