Actually I dont know much about TFS 1.1 so I dont know if it's compatible, if anyone knows, please put it in comment.
Feel free to improve it if you have an idea.
I test a similar scripts, and it works but i made some changes and I dont test that. If it works or it does not work, please tell me in comments. Thanks!
It basically allows you tu build walls in grass or in wooden floor with item id 405 depending the direction you use it.
To build you have to use the wooden hammer, id= 2556
To destroy walls you have to use the snake destroyer, id=4846
The next script you should use it with care, cause you can destroy another type of wall with the name "wooden wall", you can change the name of the walls that the script creates and change the condition (I do that in my server) or you can change the name of the other wooden wall. Or just change the script to search all the item id of the walls, I dont like this cause it's less efficient.
Feel free to improve it if you have an idea.
I test a similar scripts, and it works but i made some changes and I dont test that. If it works or it does not work, please tell me in comments. Thanks!
It basically allows you tu build walls in grass or in wooden floor with item id 405 depending the direction you use it.
To build you have to use the wooden hammer, id= 2556
To destroy walls you have to use the snake destroyer, id=4846
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if itemid == 405 or isGrass(target) then
local click = target:getPosition()
local playerpos = player:getPosition()
horizontal0 = {5261, 5266, 5268, 5274, 5275}
vertical0 = {5262, 5264, 5270, 5272, 5273}
local items ={
{5263, vertical0[math.random(1,5)], vertical0[math.random(1,5)]},
{horizontal0[math.random(1,5)],0,horizontal0[math.random(1,5)]},
{horizontal0[math.random(1,5)], vertical0[math.random(1,5)], 5265},
}
local i = click.x-playerpos.x+2
local j = click.y-playerpos.y+2
doCreateItem(items[j][i], 1, click)
click:sendMagicEffect(73)
end
end
function isGrass(item)
if item:getName() == "grass" then
return true
end
return false
end
The next script you should use it with care, cause you can destroy another type of wall with the name "wooden wall", you can change the name of the walls that the script creates and change the condition (I do that in my server) or you can change the name of the other wooden wall. Or just change the script to search all the item id of the walls, I dont like this cause it's less efficient.
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local targetpos = target:getPosition()
if isWoodenWall(target) then
target:remove()
targetpos:sendMagicEffect(3)
return true
end
end
function isWoodenWall(item)
local id = item.itemid
if item:getName() == "wooden wall" then
return true
end
for j=5278,5283 do
if id == j then
return true
end
end
return false
end
Code:
<action itemid="2556" script="simplebuild.lua" />
<action itemid="4846" script="removewall.lua" />
Last edited: