matthewharrison
New Member
- Joined
- Nov 21, 2011
- Messages
- 42
- Reaction score
- 1
Hi, I have a script for removing walls, it works fine, but I wanted to change it, if possible. I'll post the script then talk about what I'm trying to do below it. Here's the script:
Now what I'm trying to do is change it so that it will remove the wall, let's say, 2 tiles to the right, so X+2 from the tile position. I want to have the script made so that it can get the players position, or tile position, and add 2 to the X value of that position, then it would remove the wall two tiles away, instead of having to put the coordinates in.
Reason for this is because I have a bunch of spaces on my map where this script is going to be used, and the walls are all the same distance away from the tiles being stepped on, so instead of having to find a bunch of coordinates, I can just set the actionid on the tile and be good to go!
Any help would be greatly appreciated!!!
Code:
local wall = [B][COLOR="#FF0000"]{x=501, y=301, z=11}[/COLOR][/B][B] ---- I want to make this to x+2 somehow, instead of writing out the coordinates[/B]
local wallid = 1111
function onStepIn(cid, item, pos)
local getwall = getTileItemById(wall, wallid)
if(isPlayer(cid)) then
if item.actionid == 15000 then
doRemoveItem(getwall.uid, 1)
doTransformItem(item.uid, 425)
elseif item.actionid == 15001 then
doCreateItem(wallid, 1, wall)
doTransformItem(item.uid, 426)
end
end
return true
end
Now what I'm trying to do is change it so that it will remove the wall, let's say, 2 tiles to the right, so X+2 from the tile position. I want to have the script made so that it can get the players position, or tile position, and add 2 to the X value of that position, then it would remove the wall two tiles away, instead of having to put the coordinates in.
Reason for this is because I have a bunch of spaces on my map where this script is going to be used, and the walls are all the same distance away from the tiles being stepped on, so instead of having to find a bunch of coordinates, I can just set the actionid on the tile and be good to go!
Any help would be greatly appreciated!!!

