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

Help convertion script to 1.x

dervin13

Active Member
Joined
Apr 26, 2008
Messages
458
Solutions
1
Reaction score
28
Anyone can help to convert this talkaction? I already tried some changes but didn't work thanks

Code:
local temple = {x=100, y=100, z=7} -- Lugar onde será teleportado

local level = 100 -- Level minimo para poder usar o item

local pz = true -- players precisam estar em protection zone para usar? (true ou false)

local storage = 212290 -- Storage para dar exhausted

function onSay(cid, words, param)

    if pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
        return doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você precisa estar em protection zone pra poder teleportar.")
    end
    
    if getPlayerStorageValue(cid, storage) > os.time() then
        return doPlayerSendCancel(cid, "Espere " .. getPlayerStorageValue(cid, storage) - os.time() .. " segundos.")
    end
    
    if getPlayerLevel(cid) <= level then

        doTeleportThing(cid, temple, TRUE)

        doSendMagicEffect(temple,10)

        doSendAnimatedText(temple, "Events!", 5)
        
    setPlayerStorageValue(cid, storage, os.time() + 10) -- tempo em segundos.

    else

        doPlayerSendCancel(cid, "Desculpe, você precisa ser menor que o level "..level.." para ser teleportado.")

    end

    return TRUE
end
 
Solution
Anyone can help to convert this talkaction? I already tried some changes but didn't work thanks

Code:
local temple = {x=100, y=100, z=7} -- Lugar onde será teleportado

local level = 100 -- Level minimo para poder usar o item

local pz = true -- players precisam estar em protection zone para usar? (true ou false)

local storage = 212290 -- Storage para dar exhausted

function onSay(cid, words, param)

    if pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
        return doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você precisa estar em protection zone pra poder teleportar.")
    end
   
    if getPlayerStorageValue(cid, storage) > os.time() then
        return doPlayerSendCancel(cid, "Espere " ...
Anyone can help to convert this talkaction? I already tried some changes but didn't work thanks

Code:
local temple = {x=100, y=100, z=7} -- Lugar onde será teleportado

local level = 100 -- Level minimo para poder usar o item

local pz = true -- players precisam estar em protection zone para usar? (true ou false)

local storage = 212290 -- Storage para dar exhausted

function onSay(cid, words, param)

    if pz == true and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
        return doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"Você precisa estar em protection zone pra poder teleportar.")
    end
   
    if getPlayerStorageValue(cid, storage) > os.time() then
        return doPlayerSendCancel(cid, "Espere " .. getPlayerStorageValue(cid, storage) - os.time() .. " segundos.")
    end
   
    if getPlayerLevel(cid) <= level then

        doTeleportThing(cid, temple, TRUE)

        doSendMagicEffect(temple,10)

        doSendAnimatedText(temple, "Events!", 5)
       
    setPlayerStorageValue(cid, storage, os.time() + 10) -- tempo em segundos.

    else

        doPlayerSendCancel(cid, "Desculpe, você precisa ser menor que o level "..level.." para ser teleportado.")

    end

    return TRUE
end

There you go. It's tfs 1.X which means there is no animated text function but other than that everything else should work

Lua:
-- local variables
local temple = {x = 100, y = 100, z = 7} -- Lugar onde será teleportado
local level = 100 -- Level minimo para poder usar o item
local pz = true -- players precisam estar em protection zone para usar? (true ou false)
local storage = 212290 -- Storage para dar exhausted

function onSay(cid, words, param)
    local player = Player(cid)
    if not player then
        return false
    end
    
    if pz and getTilePzInfo(player:getPosition()) == false then
        return player:sendTextMessage(MESSAGE_EVENT_DEFAULT, "Você precisa estar em protection zone pra poder teleportar.")
    end
    
    local storageValue = player:getStorageValue(storage)
    if storageValue > os.time() then
        return player:sendCancelMessage("Espere " .. storageValue - os.time() .. " segundos.")
    end
    
    if player:getLevel() <= level then
        player:teleportTo(Position(temple), false)
        Position(temple):sendMagicEffect(10)
        player:setStorageValue(storage, os.time() + 10) -- tempo em segundos.
    else
        return player:sendCancelMessage("Desculpe, você precisa ser menor que o level " ..level.. " para ser teleportado.")
    end

    return true
end
 
Solution
Back
Top