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

TFS 1.2 Ghost command gives critical error

Stanos

Veteran OT User
Joined
Jun 12, 2018
Messages
584
Solutions
4
Reaction score
314
Location
Europe
So title says everything after i trying to become ghost(invisible) i get critical client error.
Untitled.png

Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    local position = player:getPosition()
    local isGhost = not player:isInGhostMode()

    player:setGhostMode(isGhost)
    if isGhost then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You are now invisible.")
        position:sendMagicEffect(CONST_ME_YALAHARIGHOST)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You are visible again.")
        position.x = position.x + 1
        position:sendMagicEffect(CONST_ME_SMOKE)
    end
    return false
end
 
Solution
S
Just open enums.h and change those zeros to your ot blue magic outfit id
C++:
struct Outfit_t {
    uint16_t lookType = 0;
    uint16_t lookTypeEx = 0;
    uint16_t lookMount = 0;
    uint8_t lookHead = 0;
    uint8_t lookBody = 0;
    uint8_t lookLegs = 0;
    uint8_t lookFeet = 0;
    uint8_t lookAddons = 0;
};

Since you are using a different style not a real tibia style its dragon ball so it may work like this
Try to remove the line no.17 , since i don't know the client you are using maybe in your src files you changed something that causes error because of this magic effect just try if it worked without errors msg me on discord
 
what about it:
Lua:
function onSay(player, words, param)
   if not player:getGroup():getAccess() then
  return true
end

if player:getAccountType() < ACCOUNT_TYPE_GOD then
     return false
end


 local position = player:getPosition()
   local isGhost = not player:isInGhostMode()


if isGhost then
     player:setGhostMode(true)

    player:sendTextMessage(MESSAGE_INFO_DESCR, "You are now invisible.")
     position:sendMagicEffect(CONST_ME_YALAHARIGHOST)
    else
      player:setGhostMode(false)
     player:sendTextMessage(MESSAGE_INFO_DESCR, "You are visible again.")
      position.x = position.x + 1
    position:sendMagicEffect(CONST_ME_SMOKE)
  end
return false
end
 
what about it:
Lua:
function onSay(player, words, param)
   if not player:getGroup():getAccess() then
  return true
end

if player:getAccountType() < ACCOUNT_TYPE_GOD then
     return false
end


 local position = player:getPosition()
   local isGhost = not player:isInGhostMode()


if isGhost then
     player:setGhostMode(true)

    player:sendTextMessage(MESSAGE_INFO_DESCR, "You are now invisible.")
     position:sendMagicEffect(CONST_ME_YALAHARIGHOST)
    else
      player:setGhostMode(false)
     player:sendTextMessage(MESSAGE_INFO_DESCR, "You are visible again.")
      position.x = position.x + 1
    position:sendMagicEffect(CONST_ME_SMOKE)
  end
return false
end
same
 
Just open enums.h and change those zeros to your ot blue magic outfit id
C++:
struct Outfit_t {
    uint16_t lookType = 0;
    uint16_t lookTypeEx = 0;
    uint16_t lookMount = 0;
    uint8_t lookHead = 0;
    uint8_t lookBody = 0;
    uint8_t lookLegs = 0;
    uint8_t lookFeet = 0;
    uint8_t lookAddons = 0;
};

Since you are using a different style not a real tibia style its dragon ball so it may work like this
 
Solution
Just open enums.h and change those zeros to 2 or 3
C++:
struct Outfit_t {
    uint16_t lookType = 0;
    uint16_t lookTypeEx = 0;
    uint16_t lookMount = 0;
    uint8_t lookHead = 0;
    uint8_t lookBody = 0;
    uint8_t lookLegs = 0;
    uint8_t lookFeet = 0;
    uint8_t lookAddons = 0;
};
Young god
 
Back
Top