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

Lua Say function

Materion

New Member
Joined
Feb 18, 2012
Messages
81
Reaction score
2
Hello It's me again. There is a function that make player talk? Example - some player walk into some tile and then script is activated and that player automatically says "Argh!".
 
I am new to lua scripting. I wanna learn so im gonna try help you out

Lua:
function onStepIn(cid, item, frompos, itemEx, topos)
if item.itemid == XXXX then
doPlayerSendTextMessage(cid,21,"Argh!", 
return TRUE
end
Correct me if im wrong
 
Lua:
function onStepIn(cid, item, position, fromPosition)
	if not isPlayer(cid) then
		return true
	end

	doCreatureSay(cid, "Argh!", TALKTYPE_SAY)
	return true
end
 
I am new to lua scripting. I wanna learn so im gonna try help you out

Lua:
function onStepIn(cid, item, frompos, itemEx, topos)
if item.itemid == XXXX then
doPlayerSendTextMessage(cid,21,"Argh!", 
return TRUE
end
Correct me if im wrong

wrong function missing bracket and badly made. and missing end for the if.
 
doPlayerSendTextMessage gives a message to the player, it does not make the player say something.
You don't have to check for itemid, itemid, uniqueid or actionid are already in movements.xml.
 
Last edited:
@Dest
No contants, "end" missing, no tabs, "," instead of ")" and itemid is checked in movements.xml usually, wrong function also.
 
Just keep learning, i remember my first script. They found 10+ misstakes xD, i took them in and learned on that way. Only thing i need learn mostly about loops and tables xD
 
Last edited:
Thank you for your help ! I think I am on a good way to make my critical damage passive spell to be made ;). I will make spell that will do it and i will make function onAttack that will cast that spell if player will have it on every attack :). That's why i needed function that will make player say something to cast that spell :).
 
Back
Top