• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Talkaction add player cancels

WiLDTuRTLE

Member
Joined
Feb 26, 2011
Messages
478
Reaction score
5
I been trying to add lines to it so when the player own no house, it says "You don't own a house" , atm it says you are pz cuz the player doesnt have a house


Code:
function onSay(cid, words, param, channel)
    if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE and getHouseByPlayerGUID(getPlayerGUID(cid)) then
        if getPlayerPromotionLevel(cid) == 1 then
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need promotion!")
            return TRUE
        end
        doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
    else
        doSendMagicEffect(getPlayerPosition(cid),0)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are PZ.")
    end
    return true 
end
 
-edit- Actually you just need to change this line:
LUA:
(cid, MESSAGE_INFO_DESCR, "You are PZ.")
If the script actually works, looking at it makes me want to puke.
 
Last edited:
LUA:
function onSay(cid, words, param, channel)
    if not(getHouseByPlayerGUID(getPlayerGUID(cid))) then
        doPlayerSendCancel(cid, "You do not own a house.")
        return true
    end

    if getCreatureCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "You are PZ.")
        return true
    end

    if getPlayerPromotionLevel(cid) == 1 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need promotion!")
        return true
    end

    doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
    return true 
end
 
Last edited:
LUA:
function onSay(cid, words, param, channel)
    if not(getHouseByPlayerGUID(getPlayerGUID(cid))) then
        doPlayerSendCancel(cid, "You do not own a house.")
        return true
    end

    if getCreatureCondition(cid, CONDITION_INFIGHT) then
        doPlayerSendCancel(cid, "You are PZ.")
        return true
    end

    if getPlayerPromotionLevel(cid) == 1 then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need promotion!")
        return true
    end

    doTeleportThing(cid, getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid))))
    return true 
end

it does say you do not own a house, if he dont but if he do own a house it say you are pz.
 
Last edited by a moderator:
Back
Top