• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Fixxed /makesay for TFS 0.3.5 PL1

I changed it a little so you can make npcs/monsters talk also :)
Code:
function onSay(cid, words, param)
    local param2 = string.explode(param, ",")
    if(param2[1] ~= nil) then
		local target = getPlayerByNameWildcard(param2[1])
		if(not target) then
			target = getCreatureByName(param2[1])
			if(not target) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.")
				return true
			end
		end
      if(param2[2] ~= nil) then
        text = param2[2]
      end
      doCreatureSay(target, text, TALKTYPE_SAY)
    else
      doPlayerSendCancel(cid, "Failed. Please try again.")
    end
    return TRUE

end
 
Well,
never heard about
Lua:
		local target = getPlayerByNameWildcard(param2[1])

Also about getPlayerByNameWildcard ?

New in TFS?
Cuz i didnt Script, means worked with Tibia for a while Hehe

Regards,
Cazar
 
Back
Top