• 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!

RevScripts tfs 1.5 Search for a script for the hunt but in order to enter the place it takes money or tokens from you

Madusa

Active Member
Joined
Sep 8, 2022
Messages
123
Reaction score
34
Location
Egypt
tfs 1.5 Search for a script for the hunt but in order to enter the place it takes money or tokens from you
Example: I created a new place for hunting, and I want entry there not to be free in exchange for currency, money, or tokens
thank you in advance
 
Solution
I took his script and made a small correction and cleaned up the syntax, and it turned out better. If it still doesn't work, test it here. It has been tested and is functional. Okay!

Lua:
local config = {
    actionId = 59395,
    tokenItemId = 2638, -- token item ID
    tokenCount = 10, --Amount of tokens required
    requiredLevel = 8,
}

local moveEvent = MoveEvent()

function moveEvent.onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    if player:getLevel() < config.requiredLevel then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You need to be at least level ' .. config.requiredLevel .. ' to pass.')...
Lua:
local moveEvent = MoveEvent()

local config = {
    actionId = 59395,
    moneyAmount = 100,
    requiredLevel = 10,
}

function moveEvent.onStepIn(player, item, pos, fromPosition)
    if player:getLevel() < config.requiredLevel then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You need to be atleast level '..config.requiredLevel..' to pass.')
        return true
    end
    if not player:removeMoney(config.moneyAmount) then
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end
    return true
end

moveEvent:aid(config.actionId)
moveEvent:register()

You can remove the level check if you don't need it tho :D
I made it only with money because u didn't say what u exactly want to remove :D
 
Last edited:
Lua:
local moveEvent = MoveEvent()

local config = {
    actionId = 59395,
    moneyAmount = 100,
    requiredLevel = 10,
}

function moveEvent.onStepIn(creature, item, pos, fromPosition)
    if player:getLevel() < config.requiredLevel then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You need to be atleast level '..config.requiredLevel..' to pass.')
        return true
    end
    if not player:removeMoney(config.moneyAmount) then
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end
    return true
end

moveEvent:aid(config.actionId)
moveEvent:register()

You can remove the level check if you don't need it tho :D
I made it only with money because u didn't say what u exactly want to remove :D
How to do it take tokens id 2638,10
 
Code:
local moveEvent = MoveEvent()
local config = {
    actionId = 59395,
    moneyAmount = 10,
    requiredLevel = 10,
}
function moveEvent.onStepIn(creature, item, pos, fromPosition)
    if player:getLevel() < config.requiredLevel then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You need to be atleast level '..config.requiredLevel..' to pass.')
        return true
    end
   if not player:removeItem(2638, 10) then
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end
    return true
end
moveEvent:aid(config.actionId)
moveEvent:register()
thus?
or remove moneyAmount = 10,?
 
I took his script and made a small correction and cleaned up the syntax, and it turned out better. If it still doesn't work, test it here. It has been tested and is functional. Okay!

Lua:
local config = {
    actionId = 59395,
    tokenItemId = 2638, -- token item ID
    tokenCount = 10, --Amount of tokens required
    requiredLevel = 8,
}

local moveEvent = MoveEvent()

function moveEvent.onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    if player:getLevel() < config.requiredLevel then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You need to be at least level ' .. config.requiredLevel .. ' to pass.')
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    if player:getItemCount(config.tokenItemId) < config.tokenCount then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You need to have at least ' .. config.tokenCount .. ' tokens to pass.')
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    if not player:removeItem(config.tokenItemId, config.tokenCount) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Sorry, something went wrong with removing the tokens.')
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    return true
end

moveEvent:aid(config.actionId)
moveEvent:register()
 
Solution
Code:
local moveEvent = MoveEvent()
local config = {
    actionId = 59395,
    moneyAmount = 10,
    requiredLevel = 10,
}
function moveEvent.onStepIn(creature, item, pos, fromPosition)
    if player:getLevel() < config.requiredLevel then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You need to be atleast level '..config.requiredLevel..' to pass.')
        return true
    end
   if not player:removeItem(2638, 10) then
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end
    return true
end
moveEvent:aid(config.actionId)
moveEvent:register()
thus?
or remove moneyAmount = 10,?

its right yeah
 
I took his script and made a small correction and cleaned up the syntax, and it turned out better. If it still doesn't work, test it here. It has been tested and is functional. Okay!

Lua:
local config = {
    actionId = 59395,
    tokenItemId = 2638, -- token item ID
    tokenCount = 10, --Amount of tokens required
    requiredLevel = 8,
}

local moveEvent = MoveEvent()

function moveEvent.onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    if player:getLevel() < config.requiredLevel then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You need to be at least level ' .. config.requiredLevel .. ' to pass.')
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    if player:getItemCount(config.tokenItemId) < config.tokenCount then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'You need to have at least ' .. config.tokenCount .. ' tokens to pass.')
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    if not player:removeItem(config.tokenItemId, config.tokenCount) then
        player:sendTextMessage(MESSAGE_INFO_DESCR, 'Sorry, something went wrong with removing the tokens.')
        player:teleportTo(fromPosition)
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        return true
    end

    return true
end

moveEvent:aid(config.actionId)
moveEvent:register()
Thank you Your script works well
 
Back
Top