Hello, an small script for TFS 1.0.. When you stepin on the tile, you need to be the vocation as presented in config. Enable or disable payment as well.
Wall of helpers:
@sn3ejk @Ninja @Evan
Movements.xml
- Remember to set the uniqueid on the tile.
test.lua
Hope you enjoy it.
Wall of helpers:
@sn3ejk @Ninja @Evan
Movements.xml
Code:
<movevent event="StepIn" uniqueid="65535" script="test.lua"/>
test.lua
Code:
local config = {
-- Where to teleport the player
-- X , Y , Z
position = Position(20, 323, 7),
-- What vocation you need to enter?
vocation = {1,2,3,4},
-- Enable cost to enter?
-- This is 10 Crystal coins.
itemCostEnable = true,
itemID = 2160,
itemCount = 10
}
function onStepIn(cid, item, position, fromPosition)
local player = Player(cid)
if player then
if isInArray(config.vocation, player:getVocation():getId()) then
if config.itemCostEnable then
if player:removeItem(config.itemID, config.itemCount) then
player:teleportTo(config.position,1)
config.position:sendMagicEffect(11)
return true
else
player:sendTextMessage(4, 'You need '..config.itemCount..'x of '..ItemType(config.itemID):getName()..' to pass.')
player:teleportTo(fromPosition,1)
fromPosition:sendMagicEffect(16)
return false
end
end
player:teleportTo(config.position,1)
config.position:sendMagicEffect(11)
return true
else
player:sendTextMessage(4,'You dont have the right vocation to enter here.')
player:teleportTo(fromPosition,1)
fromPosition:sendMagicEffect(16)
return false
end
else
return false
end
return true
end
Hope you enjoy it.
Last edited: