Diarreamental
Banned User
- Joined
- Jul 6, 2015
- Messages
- 463
- Solutions
- 1
- Reaction score
- 85
Hello guys after migrating to tfs 1.3 few scrpits had changed its behavior and they are not working 100%
exampe brigde lever script works good, but a feature that used to work in older distributions now doesn't.
In this case if there is blood on the brigde and you pull the lever to remove the brigde it should remove the blood that was on the brigde too
(it working with corpses , items and player but not blood)
or could omebody what function i should add to make this work like i want?
wall remove
if there is a player standing where the wall will appear the wall should push the player 1 sqm back
the same for dead corpses, items and if there is blood where the wall will appear it will be shown below the wall not above
this is to remove // create 1 sqm of "roof" when lever is used
if there is an item or a player where and when the roof will be removed the player and items on it, should fall down to the floor
if there's blood, the blood should be removed
thanks
exampe brigde lever script works good, but a feature that used to work in older distributions now doesn't.
In this case if there is blood on the brigde and you pull the lever to remove the brigde it should remove the blood that was on the brigde too
(it working with corpses , items and player but not blood)
or could omebody what function i should add to make this work like i want?
Code:
local config = {
bridgePositions = {
{position = Position(32099, 32205, 8), groundId = 352, itemId = 352},
{position = Position(32100, 32205, 8), groundId = 508, itemId = 508},
{position = Position(32101, 32205, 8), groundId = 509, itemId = 509}
},
leverPositions = {
Position(32098, 32204, 8),
Position(32104, 32204, 8)
},
relocatePosition = Position(32102, 32205, 8),
relocateMonsterPosition = Position(32103, 32205, 8),
bridgeId = 1284
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local leverLeft, lever = item.itemid == 1945
for i = 1, #config.leverPositions do
lever = Tile(config.leverPositions[i]):getItemById(leverLeft and 1945 or 1946)
if lever then
lever:transform(leverLeft and 1946 or 1945)
end
end
local tile, tmpItem, bridge
if leverLeft then
for i = 1, #config.bridgePositions do
bridge = config.bridgePositions[i]
tile = Tile(bridge.position)
tmpItem = tile:getGround()
if tmpItem then
tmpItem:transform(config.bridgeId)
end
if bridge.itemId then
tmpItem = tile:getItemById(bridge.itemId)
if tmpItem then
tmpItem:remove()
end
end
end
else
for i = 1, #config.bridgePositions do
bridge = config.bridgePositions[i]
tile = Tile(bridge.position)
tile:relocateTo(config.relocatePosition, true, config.relocateMonsterPosition)
tile:getGround():transform(bridge.groundId)
Game.createItem(bridge.itemId, 1, bridge.position)
end
end
return true
end
wall remove
if there is a player standing where the wall will appear the wall should push the player 1 sqm back
the same for dead corpses, items and if there is blood where the wall will appear it will be shown below the wall not above
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local tile = Tile(Position({x = 32566, y = 32119, z = 7}))
if item.itemid == 1945 then
if tile:getItemById(1025) then
tile:getItemById(1025):remove()
item:transform(1946)
else
Game.createItem(1025, 1, {x = 32566, y = 32119, z = 7})
end
else
Game.createItem(1025, 1, {x = 32566, y = 32119, z = 7})
item:transform(1945)
end
return true
end
this is to remove // create 1 sqm of "roof" when lever is used
if there is an item or a player where and when the roof will be removed the player and items on it, should fall down to the floor
if there's blood, the blood should be removed
Code:
local postile = { x = 32398, y = 32239, z = 6, stackpos = 0 }
function onUse(cid, item, frompos, item2, topos)
local tile = getThingfromPos(postile)
local levpos = getThingPos(item.uid)
levpos.stackpos = 253
local topCreature = getThingfromPos(levpos)
if topCreature.uid ~= 0 then
doPlayerSendCancel(cid, 'Sorry, not possible.')
return true
end
local topCreature2 = getThingfromPos({ x = 32398, y = 32239, z = 6, stackpos = 253 })
if topCreature2.uid ~= 0 then
local lastPos = getCreatureLastPosition(topCreature2.uid)
doTeleportThing(topCreature2.uid, lastPos, true)
end
if item.actionid == 4024 and item.itemid == 1945 then
doRemoveItem(tile.uid, 1)
doCreateItem(429, 1, postile)
doTransformItem(item.uid, item.itemid+1)
elseif item.actionid == 4024 and item.itemid == 1946 then
doRemoveItem(tile.uid, 1)
doCreateItem(405, 1, postile)
doTransformItem(item.uid, item.itemid-1)
end
return true
end
thanks
Last edited: