• 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 pass !life to tfs 1.4

denis1533

New Member
Joined
Jun 20, 2021
Messages
5
Reaction score
0
there is no tag because it is directly in the script

function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida atual: " .. getCreatureHealth(cid) .. "\nVida máxima: " .. getCreatureMaxHealth(cid) .. "")
return
end

if isPremium(cid) == true then
local pid = getPlayerName(cid)
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O jogador com o nome " .. param .. " não esta online ou não existe.")
return
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "\nVida de [ " .. getCreatureName(pid) .. " ] atual: " .. getCreatureHealth(pid) .. "\nVida de [ " .. getCreatureName(pid) .. " ] máxima: " .. getCreatureMaxHealth(pid) .. "")
return
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Apenas jogadores VIP podem utilizar este comando para visualizar informações de outros jogadores.")
return
end
end[/spoiler/
 
honestly I was too lazy to convert it manually, so asked chatGPT to do it for me.

Looks like it should work. xD

Code:
Do you know of The Forgotten Server, aka TFS?
Code:
Yes, TFS stands for The Forgotten Server, an open-source MMORPG server for the game Tibia.
Code:
Can you convert this script from tfs 0.4 to tfs 1.3+ functions? "pasted your code"
Code:
Here's the conversion of the script to TFS 1.3+ functions:
Lua:
function onSay(player, words, param, channel)
    if param == '' then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Current life: " .. player:getHealth() .. "\nMaximum life: " .. player:getMaxHealth() .. "")
        return true
    end

    if player:isPremium() then
        local target = Player(param)
        if not target or (target:isGhost() and target:getGhostAccess() > player:getGhostAccess()) then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The player with the name " .. param .. " is not online or does not exist.")
            return true
        end
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Current life of [" .. target:getName() .. "]: " .. target:getHealth() .. "\nMaximum life of [" .. target:getName() .. "]: " .. target:getMaxHealth() .. "")
        return true
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Only VIP players can use this command to view information about other players.")
        return true
    end
end
 
Incredible..
honestly I was too lazy to convert it manually, so asked chatGPT to do it for me.

Looks like it should work. xD

Code:
Do you know of The Forgotten Server, aka TFS?
Code:
Yes, TFS stands for The Forgotten Server, an open-source MMORPG server for the game Tibia.
Code:
Can you convert this script from tfs 0.4 to tfs 1.3+ functions? "pasted your code"
Code:
Here's the conversion of the script to TFS 1.3+ functions:
Lua:
function onSay(player, words, param, channel)
    if param == '' then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Current life: " .. player:getHealth() .. "\nMaximum life: " .. player:getMaxHealth() .. "")
        return true
    end

    if player:isPremium() then
        local target = Player(param)
        if not target or (target:isGhost() and target:getGhostAccess() > player:getGhostAccess()) then
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "The player with the name " .. param .. " is not online or does not exist.")
            return true
        end
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Current life of [" .. target:getName() .. "]: " .. target:getHealth() .. "\nMaximum life of [" .. target:getName() .. "]: " .. target:getMaxHealth() .. "")
        return true
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Only VIP players can use this command to view information about other players.")
        return true
    end
end
 
Back
Top