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

problem with my door that opens with key

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
Hi, I have donde the thing that all have told me... to have a key and a door and they must have the same actionid. But when I use the key it says "the key doesnt match"

so I look for a script and found this one:

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

closed_doors = {1241, 1237, 1231}
open_doors = {1238, 1233, 1242}

if item2.actionid == item.actionid then
if isInArray(item2.itemid, closed_doors)
doTransformItem(item.uid, item.itemid+1)
elseif isInArray(item2.itemid, open_doors) then
doTransformItem(item.uid, item.itemid-1)
end
end
return 1
end

and in the server has this problem:

[12/02/2011 12:10:41] Warning: [Event::checkScript] Can not load script. /scripts/other/llavepiramide.lua
[12/02/2011 12:10:41] data/actions/scripts/other/key1:8: 'then' expected near 'doTransformItem'

im using tfs 0.2.9... how do I solve it? rep
 
Code:
function onUse(cid, item, frompos, item2, topos)

closed_doors = {1241, 1237, 1231}
open_doors = {1238, 1233, 1242}

if item2.actionid == item.actionid then
     if isInArray(item2.itemid, closed_doors) [b]then[/b]
          doTransformItem(item.uid, item.itemid+1)
     elseif isInArray(item2.itemid, open_doors) then
          doTransformItem(item.uid, item.itemid-1)
     end
end
return 1
end

missed a "then" ;)
also, tidied the code up a tiny bit (put code tags around your paste rather than quote ;))
 
Back
Top Bottom