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

Lua Some Scripts.

Elexonic

Well-Known Member
Joined
Jun 18, 2008
Messages
1,920
Reaction score
59
Need help scrtip some I do not work well, others to see if it can optimize and repair.

1º-> when you sell to a npc gives me this error-... --- Fixed


2º-> this script I want to see if you can do simpler or change some code to work better.

Code:
function onUse(cid, item, frompos, item2, topos)

if getPlayerLevel(cid) > 1 then
if (os.time() - getPlayerStorageValue(cid,4826) > 10*1) then
arena = {x=1151, y=1377, z=5}
doSummonCreature("wyvern", {x=1147, y=1379, z=5})
doTeleportThing(cid,arena,0)
doSendMagicEffect(arena,10)
setPlayerStorageValue(cid,4826,os.time())
else
doPlayerSendCancel(cid,'Wait.')
doSendMagicEffect(topos,2)
end
else
doSendMagicEffect(topos,2)
end

return 1
end

3º>

-Fixed By Strack!

4ºError in position :S --- Fixed By VirrageS

6º In ALL npc, when I say trade, bye ... Fixed

7ºwhen I open a door once the Pirmez works well ... but when you give the sec might not work.
The problem is that id is changed and I think that is why the problem.
Anyone know how to fix it?


FIxed



Bye!
 
Last edited:
Solved error in doors-
Thanks Lagmacun and strack :)

Need help in this scrtip sumon monster--

local config = {
leverUid = 17030, -- lever UniqueID
leverPos = {x=32346, y=31790, z=7, stackpos=1}, -- lever pos
monsterPos = {x=32346, y=31789, z=7, stackpos=1}, -- monster pos
nameMonster = "Dragon", -- monster name
effect = CONST_ME_TELEPORT, -- effect when lever appears/disappear
messageTwo = "Sorry, not possible.", -- message that returns when player pull on the lever until lever back off
timeRemove = 5, -- Time, in seconds to 'exaust'
}


function onUse(cid, item, frompos, item2, topos, position)
if item.uid == config.leverUid and item.itemid == 1945 then
doCreateMonster(config.nameMonster, config.monsterPos, true)
doSendMagicEffect(config.monsterPos, config.effect)
addEvent(returnLever, config.timeRemove * 1000)
elseif item.uid == config.leverUid and item.itemid == 1946 then
doPlayerSendCancel(cid, config.messageTwo)
return TRUE
end
end



function returnLever()
if getThingfromPos(config.leverPos).uid > 0 then
doTransformItem(getThingfromPos(config.leverPos).uid, 1945)
doSendMagicEffect(config.leverPos, CONST_ME_POFF)
end
end

Have error in doTransformItem :S
 
I can not say the line but it gives you error when you put the lever up or put up something .. fails and no longer works but the lever: S
 
i remember i've tried once something like this, seems u cant transform an item via- trnsform function on a TimeEvent 'cause it doesnt match de item, i think it cheks the first item before doing nothing, and then when u change first time the items its not the same as before so the timeEvent(transform) doesnt match it.
Later or tomorrow (when I have time) i'll read the script code and see why it gives u error but maybe is for that problem I said with timeEvents and transform items

pd: it could be also a problem of stackpos dunno
 
All error fixed.
Npc and doors-

This script continue error :S

local config = {
leverUid = 17030, -- lever UniqueID
leverPos = {x=32346, y=31790, z=7, stackpos=1}, -- lever pos
monsterPos = {x=32346, y=31789, z=7, stackpos=1}, -- monster pos
nameMonster = "Dragon", -- monster name
effect = CONST_ME_TELEPORT, -- effect when lever appears/disappear
messageTwo = "Sorry, not possible.", -- message that returns when player pull on the lever until lever back off
timeRemove = 5, -- Time, in seconds to 'exaust'
}


function onUse(cid, item, frompos, item2, topos, position)
if item.uid == config.leverUid and item.itemid == 1945 then
doCreateMonster(config.nameMonster, config.monsterPos, true)
doSendMagicEffect(config.monsterPos, config.effect)
addEvent(returnLever, config.timeRemove * 1000)
elseif item.uid == config.leverUid and item.itemid == 1946 then
doPlayerSendCancel(cid, config.messageTwo)
return TRUE
end
end



function returnLever()
if getThingfromPos(config.leverPos).uid > 0 then
doTransformItem(getThingfromPos(config.leverPos).u id, 1945)
doSendMagicEffect(config.leverPos, CONST_ME_POFF)
end
end
 
Lua:
local config = {
monsterPos = {x=999, y=1011, z=7}, -- monster pos
nameMonster = "Dragon", -- monster name
timeRemove = 5, -- Time, in seconds to 'exaust'
storage = 48586,
}

function onUse(cid, item, frompos, item2, topos, position)
	if exhaustion.check(cid, config.storage) == false then
		doCreateMonster(config.nameMonster, config.monsterPos)
		exhaustion.set(cid, config.storage, config.timeRemove)
	else
		doPlayerSendCancel(cid, 'You should wait ' ..exhaustion.get(cid, config.storage)..' sec to write report again.')
	end
end

stop bumping ride ;)
 
Back
Top