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

Command to create tp with action, why she's display on default say?

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hi, i have script for create teleport with actionid and it work normaly, but why when i say only !event i dont see anything on default only sendCancelMessage, but when i use !event trash i see this command on default chat why?


Code:
function onSay(player, words, param)
        if param == '' then
            player:sendCancelMessage("Wrong command")
            return false
        elseif param == 'trash' then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "tp open")
            local tp_pos = Position(1014, 997, 7)
            local teleport = Game.createItem(1387, 1, tp_pos)
            if teleport then
                teleport:setActionId(10038)
            end
        elseif param == 'test' then
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "test")
        end
        return true
end

//edit i wanna hide command on default chat, cuz script working
 
Last edited:
change return true on line 15 to return false

Yep it work thanks, i have one more question why return false? if function is made?
I try hard to understand all these functions, and I always thought we would return true if the function is executed correctly: D
 
Yep it work thanks, i have one more question why return false? if function is made?
I try hard to understand all these functions, and I always thought we would return true if the function is executed correctly: D
If it returns true your text executes successfully, but since we don't want the text to show, we return false.

Another spot we often return false is when using onLook functions, since we generally don't want the original text to show and only the modified/new text.

Just depends on the situation. :)
 
Back
Top