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

Solved Script

Kanto

So.. you want a cookie?
Joined
Feb 28, 2008
Messages
90
Reaction score
0
Location
Jämtland. :)
~~~~SOLVED PROBLEM~~~~
Hello.. This is a script(NOT MADE BY ME) it is suppose to remove a wall if you put a monsters corpse on a tile and pull a swith. But the switch is able to use all the time.. and nothing happens. So can any one help me with this... :confused:

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

local switchUniqueID = 37271 -- uniqueID of switch
local switchID = 1945
local switch2ID = 1946
local itemID = 5527
local itempos = {x=1189, y=1198, z=12, stackpos=1}
local wallpos = {x=1187, y=1199, z=12, stackpos=1}

local playername = getPlayerName(cid)
local getitem = getThingfromPos(itempos)
local wallchk = getThingfromPos(wallpos)

if item.uid == switchUniqueID and item.itemid == switchID and getitem.itemid == itemID and wallchk.itemid == 3458 then
doSendMagicEffect(itempos,10)
doSendMagicEffect(wallchk,10)
doRemoveItem(getitem.uid,1)
doRemoveItem(wallchk.uid,1)
doTransformItem(item.uid,item.itemid+1)
addEvent(onTimer2, 2*60*1000)
elseif item.uid == switchUniqueID and item.itemid == switch2ID then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"You need to place the corpse of boss to remove wall to get prize!")
end
return 1
end


function onTimer2()

wallnewpos = {x=1187, y=1199, z=12}
doCreateItem(3458,1,wallnewpos)
end
Something is wrong but I don't know what.. :( I added ActionID: [5002]. and
UniqueID: [37272]. to the swith.
I use it for my inq. I give rep++
 
Last edited:
Lua:
function onUse(cid, item, frompos, item2, topos)

local switchUniqueID = 37271 -- uniqueID of switch
local switchID = 1945
local switch2ID = 1946
local itemID = 5527
local itempos = {x=1189, y=1198, z=12, stackpos=1}
local wallpos = {x=1187, y=1199, z=12, stackpos=1}

local playername = getPlayerName(cid)
local getitem = getThingfromPos(itempos)
local wallchk = getThingfromPos(wallpos)

if item.uid == switchUniqueID and item.itemid == switchID and getitem.itemid == itemID and wallchk.itemid == 3458 then
doSendMagicEffect(itempos,10)
doSendMagicEffect(wallchk,10)
doRemoveItem(getitem.uid,1)
doRemoveItem(wallchk.uid,1)
doTransformItem(item.uid,item.itemid+1)
addEvent(onTimer2, 2*60*1000)
elseif item.uid == switchUniqueID and item.itemid == switch2ID then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendCancel(cid,"You need to place the corpse of boss to remove wall to get prize!")
end
return 1
end


function onTimer2()

wallnewpos = {x=1187, y=1199, z=12}
doCreateItem(3458,1,wallnewpos)
end

Bumping with this LUA tags, too see it clearly

What error does show on ur TFS Console?

try adding
Lua:
return TRUE
on the last return :S
 
There is no error shown on my TFS. Kinda strange since I added
<action uniqueid="5001" script="inqlevel/boss1.lua" />
:confused:
Also just tried: return TRUE on the last return, not working. ;S
 
Last edited:
try using
PHP:
<action uniqueid="37271" script="inqlevel/boss1.lua"/>

And on RME put those switchs, UniqueID 37271
HAHAHA... I feel so stupid I used the actionid in actions.xml when I suppose so use the uniqueid. Thanks Epic. :)

~Problem Solved~
 
Back
Top