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

Solved How to send text message from a tile?

whitevo

Feeling good, thats what I do.
Joined
Jan 2, 2015
Messages
3,452
Solutions
1
Reaction score
626
Location
Estonia
When i use Bucket of water on Campfire i want campfire say: "shhhh" with orange text.
The outcommented ones are what i tried but didn't work for me [im using TFS 1.0]

Code:
            if item.itemid == 2005 then
                if itemEx.itemid == 1423 then
                    local campfire = Tile(toPosition):getItemById(1423)
                    campfire:remove()
                    Item(item.uid):transform(item.itemid, 0)
                  
                   --itemEx:say("shhhh", TALKTYPE_MONSTER_SAY)
                   --doCreatureSay(toPosition,"shhhh",TALKTYPE_MONSTER_SAY)
                   -- doPlayerSay(speaker, "shhhh", TALKTYPE_MONSTER_SAY, false, 0, toPosition)
                   --toPosition:sendTextMessage(TALKTYPE_MONSTER_SAY, "shhh")
                    return true
                end
            end
 
Player(cid):say(TALKTYPE_MONSTER_SAY, "shhhh", toPosition)

this crashed my tibia client.

Player(cid):say(cid, TALKTYPE_MONSTER_SAY, "shhhh", toPosition)

this gives me bunch of numbers of numbers: and on the player position
 
Last edited:
i mean something like
Code:
local bucket = Position(100, 100, 7)
local spectators = Game.getSpectators(bucket, false, true, 7, 7, 5, 5)
    if #spectators > 0 then
        for i = 1, #spectators do
            spectators[i]:say("shhhh", TALKTYPE_MONSTER_SAY, false, spectators[i], bucket)
        end
    end
 
This worked
Learn from the examples, limos helped you fix your code but streamside is showing you how to make it better, read and learn, his will send the text to be displayed on all the characters screens who are near the fire, vs, just the player defined in your script.... it would seem like your way works, until someone else uses the bucket and you are standing right there but don't see the text...
 
Learn from the examples, limos helped you fix your code but streamside is showing you how to make it better, read and learn, his will send the text to be displayed on all the characters
tested

Code:
 if #spectators > 0 then
                        for i = 1, #spectators do
                            spectators[i]:say("shhhh", TALKTYPE_MONSTER_SAY, false, spectators[i], toPosition)
                            addEvent(function() spectators[i]:say("hff", TALKTYPE_MONSTER_SAY, false, spectators[i], toPosition) end, 10*60*1000)
                        end
                    end

Code:
player:say("shhh", TALKTYPE_MONSTER_SAY, false, nil, toPosition)

everyone sees the text. doesnt matter which function i use
 
mine will show the msg just to the ppl around it
hmm.
This will send the message to ppl who are not even suppose to see the text? (i mean hunting somewhere far, they wont see it, but they still get the packet?)
player:say("shhh", TALKTYPE_MONSTER_SAY, false, nil, toPosition)
 
hmm.
This will send the message to ppl who are not even suppose to see the text? (i mean hunting somewhere far, they wont see it, but they still get the packet?)
player:say("shhh", TALKTYPE_MONSTER_SAY, false, nil, toPosition)
yes mine send it just to the people is around i mean to everyone in the temple idk
 
Back
Top