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

Lua Talkaction script :D

Any errors? anyway, try this:
Code:
local c = {
    ["reston"] = 1,
    ["yalahar"] = 2,
    ["tiquanda"] = 3,
    ["norwest"] = 4,
    ["ankrahmun"] = 5,
    ["liberon"] = 6,
    ["northwind"] = 7,
    ["zao"] = 8
}
 
function onSay(cid, words, param, channel)
    if (exhaustion.get (cid, 31253)) then
        doPlayerSendCancel (cid, "You can not use this command so fast!")
        return true
    else
        exhaustion.set(cid, 31253, 1)
    end
 
    if(not getTileInfo(getThingPosition(cid)).protection) then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can change the town only in PZ zone.")
    end

    local town = c[param:lower()]
    if (not town) then
        return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please write the name of town reston,tiquanda, norwest, ankrahmun, liberon, yalahar, zao or northind.")
    end

    doTeleportThing(cid, getTownTemplePosition(town), true)
    doPlayerSetTown(cid,town)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have changed the town to: "..param.." !")
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Admin Quote: "..town.." !")
    if not isPlayerGhost(cid) then
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_STUN)
    end

    return true
end
 
Back
Top