• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Lua write on item

bpm91

Well-Known Member
Joined
May 23, 2019
Messages
622
Solutions
7
Reaction score
64
Location
Brazil
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...

leocurvelo

RuneScape OT
Joined
Jan 22, 2010
Messages
37
Solutions
2
Reaction score
78
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
Top