• 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 write on item

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
882
Solutions
7
Reaction score
123
Location
Brazil
YouTube
caruniawikibr
Hello, I would like to know How do I have a script or configuration to have a GM Doll equal to tibia Global. Where a comment is written on it according to what I want.
Tfs 1.5 772

I figured something like "only GOD" can write, after writing and giving "ok" something like a letter, so it would look like this. however common players cannot write or use it. just GOD.


Gamemaster_doll.png
 
Solution
You can try something like this:

In talkactions.xml, add:
XML:
<talkaction words="/gmdoll" separator=" " script="gmdoll.lua" />

Create gmdoll.lua inside scripts and add:

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 doll, text = player:addItem(12666)
    text = player:getName().." wrote on "..os.date("%d. %b %Y")..":\n"..param
    doll:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, text)
    return false
end

To work, you can try:
/gmdoll (description that you want)

For example:
/gmdoll Given to bpm91 in honour of his excellent work in the...
You can try something like this:

In talkactions.xml, add:
XML:
<talkaction words="/gmdoll" separator=" " script="gmdoll.lua" />

Create gmdoll.lua inside scripts and add:

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 doll, text = player:addItem(12666)
    text = player:getName().." wrote on "..os.date("%d. %b %Y")..":\n"..param
    doll:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, text)
    return false
end

To work, you can try:
/gmdoll (description that you want)

For example:
/gmdoll Given to bpm91 in honour of his excellent work in the service of the OTLand community.
s0AZbYV.png
 
Last edited:
Solution
Back
Top