• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action My script is bugged! Help [request]

Evil Mark

Active Member
Joined
Nov 23, 2008
Messages
1,707
Reaction score
32
function onUse(cid, item, frompos, item2, topos)

local wallpos1 = {x=420, y=791, z=7, stackpos=1} --- coordinates of the wall to be removed ---
local wallpos2 = {x=421, y=791, z=7, stackpos=1}
local wallpos3 = {x=422, y=791, z=7, stackpos=1}
local wall1 = getThingfromPos(wallpos1)
local wall2 = getThingfromPos(wallpos2)
local wall3 = getThingfromPos(wallpos3)
local wallID = 9485 --- item id of the wall to be removed ---


if item.itemid == 1945 then

doRemoveItem(wall1.uid, 1)
doRemoveItem(wall2.uid, 1)
doRemoveItem(wall3.uid, 1)
doTransformItem(item.uid,1946)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")


elseif item.itemid == 1946 then

doCreateItem(wall1, 1, wallpos1)
doCreateItem(wall2, 1, wallpos2)
doCreateItem(wall3, 1, wallpos3)
doTransformItem(item.uid,1945)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")

end

end






WallID: 9485
LeverID: 1945
When Pulled: 1946


Even if i draw the LEVER 100X!!!!!! The walls wont appear! or get REMOVED!! HELP ME FAST !! REP++
 
Last edited:
name that gate1.lua and save it in data/actions/scripts


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

local wallpos1 = {x=420, y=791, z=7, stackpos=1} --- coordinates of the wall to be removed ---
local wallpos2 = {x=421, y=791, z=7, stackpos=1}
local wallpos3 = {x=422, y=791, z=7, stackpos=1}
local wall1 = getThingfromPos(wallpos1)
local wall2 = getThingfromPos(wallpos2)
local wall3 = getThingfromPos(wallpos3)
local wallID = 9485 --- item id of the wall to be removed ---


if item.uid == 30066 and item.itemid == 1945 and wall1.itemid == 9485 and wall2.itemid == 9485 and wall3.itemid == 9485 then

doRemoveItem(wall1.uid, 1)
doRemoveItem(wall2.uid, 1)
doRemoveItem(wall3.uid, 1)
doTransformItem(item.uid,1946)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")


elseif item.uid == 30066 and item.itemid == 1946 and wall1.itemid == 0 and wall2.itemid == 0 and wall3.itemid == 0 then

doCreateItem(wall1, 1, wallpos1)
doCreateItem(wall2, 1, wallpos2)
doCreateItem(wall3, 1, wallpos3)
doTransformItem(item.uid,1945)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")

end

end


then add in actions.xml

<action uniqueid="30066" script="gate1.lua" />


also go into ur map editor and add that 30066 in the uid of the lever by right clicking on the lever
 
name that gate1.lua and save it in data/actions/scripts


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

local wallpos1 = {x=420, y=791, z=7, stackpos=1} --- coordinates of the wall to be removed ---
local wallpos2 = {x=421, y=791, z=7, stackpos=1}
local wallpos3 = {x=422, y=791, z=7, stackpos=1}
local wall1 = getThingfromPos(wallpos1)
local wall2 = getThingfromPos(wallpos2)
local wall3 = getThingfromPos(wallpos3)
local wallID = 9485 --- item id of the wall to be removed ---


if item.uid == 30066 and item.itemid == 1945 and wall1.itemid == 9485 and wall2.itemid == 9485 and wall3.itemid == 9485 then

doRemoveItem(wall1.uid, 1)
doRemoveItem(wall2.uid, 1)
doRemoveItem(wall3.uid, 1)
doTransformItem(item.uid,1946)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")


elseif item.uid == 30066 and item.itemid == 1946 and wall1.itemid == 0 and wall2.itemid == 0 and wall3.itemid == 0 then

doCreateItem(wall1, 1, wallpos1)
doCreateItem(wall2, 1, wallpos2)
doCreateItem(wall3, 1, wallpos3)
doTransformItem(item.uid,1945)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")

end

end


then add in actions.xml

<action uniqueid="30066" script="gate1.lua" />


also go into ur map editor and add that 30066 in the uid of the lever by right clicking on the lever


It did remove the wall, but not place it back. but the lever did go back to 1945 tough, and then freezed there :(
 
Last edited:
There are code tags [CODE.][/CODE.] BUT without the '.' you will get:

Code:
jkla;djskal

With [PHP.][/PHP.] BUT without the '.' you will get:

PHP:
if function true else blahblahblah
 
Code:
function onUse(cid, item, frompos, item2, topos)

local wallpos1 = {x=420, y=791, z=7, stackpos=1} --- coordinates of the wall to be removed ---
local wallpos2 = {x=421, y=791, z=7, stackpos=1}
local wallpos3 = {x=422, y=791, z=7, stackpos=1}
local wall1 = getThingfromPos(wallpos1)
local wall2 = getThingfromPos(wallpos2)
local wall3 = getThingfromPos(wallpos3)
local wallID = 9485 --- item id of the wall to be removed ---


if item.uid == 30066 and item.itemid == 1945 and wall1.itemid == 9485 and wall2.itemid == 9485 and wall3.itemid == 9485 then

doRemoveItem(wall1.uid, 1)
doRemoveItem(wall2.uid, 1)
doRemoveItem(wall3.uid, 1)
doTransformItem(item.uid,1946)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")


elseif item.uid == 30066 and item.itemid == 1946 and wall1.itemid == 0 and wall2.itemid == 0 and wall3.itemid == 0 then

doCreateItem(9485, 1, wallpos1)
doCreateItem(9485, 1, wallpos2)
doCreateItem(9485, 1, wallpos3)
doTransformItem(item.uid,1945)
doPlayerSendTextMessage(cid,22,"Something has moved not too far away.")

end

end


This will work xD
 
Back
Top