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

Something like doCreatureSay

Azor

Cze
Joined
Dec 14, 2008
Messages
106
Reaction score
0
Location
Poland > Zachodniopomorskie > Police
Hi. How do I convert a function (doCreatureSay) to the position, the "spirit" (can not be a npc, I do it in globalevents) says something.
For example, the function is written in the nickname "Alaze" and in this position dipslays "Alaze says: blablabla." I do not want it to be a animated text. Possible?

#edit
tfs 0.3.6pl1
 
Last edited:
(luaDoCreatureSay) Creature not found
:mad:
Code:
doSendMagicEffect({x=207,y=540,z=7}, 5)

doCreatureSay(getPlayerByName('Alaze'), 'blablabla', TALKTYPE_SAY, false, 0, {x=207,y=540,z=7})

first work, second not

Because getPlayerByName(name) returns 'cid' not 'uid'.
 
wouldn't something like this work?
Code:
local pos = {x = 206, y = 540, z = 7}
local poop = getThingPos(pos)
for _, cid in ipairs(getPlayersOnline()) do
	if getPlayerPosition(cid).x == 206 and getPlayerPosition(cid).y == 540 and getPlayerPosition(cid).z = 7 then
		if getPlayerName(cid) == "Alaze" then
			doCreatureSay(poop.uid, "Blabalbalbal!", TALKTYPE_SAY)
		end
	end
end
 
Last edited:
Because getPlayerByName(name) returns 'cid' not 'uid'.
No, you have to call it with cid :p uid of an item wouldn't work.
(luaDoCreatureSay) Creature not found
:mad:
Code:
doSendMagicEffect({x=207,y=540,z=7}, 5)

doCreatureSay(getPlayerByName('Alaze'), 'blablabla', TALKTYPE_SAY, false, 0, {x=207,y=540,z=7})

first work, second not
It's because player 'Alaze' is not online :p
 
Code:
doSendMagicEffect({x=207,y=540,z=7}, 5)
doCreatureSay(getCreatureByName('Alaze'), 'blablabla', TALKTYPE_SAY, false, 0, {x=207,y=540,z=7})
:/
 
Back
Top