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

Cut Scene in OT - Need someone to look over my code

Gaddhuve

Member
Joined
May 6, 2011
Messages
76
Solutions
1
Reaction score
19
Hi guys!

I have been trying to play around some in LUA scripting to make me a start of a cut scene code. However this peice of code does not work.

The idea is that when a player walk on a tile two NPCs will appear and start talking. I use the addEvent function for the delay between the NPC who speaks. The problem is once the player steps on the tile two NPCs appear and they say their lines all at once, so the delay function does not work the way I have set it up. The doRemoveCreature works fine but not the doCreatureSay

Lua:
local t = {

	text = 'Reincarnated. Finally!',
	text1 = 'Arise my warrior!',

	text2 = 'Stop this madness!',
	text3 = 'We are too late...',	
-------------------------------------------------
	npc = 'Ferumbras', 
	storage = 667800, 
	pos = {x=1017, y=1023, z=7},
-------------------------------------------------
	npc1 = 'Fordring',
	pos1 = {x=1024, y=1022, z=7}
	
}
 
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) and getPlayerStorageValue(cid, t.storage) == -1 then
		setPlayerStorageValue(cid, t.storage, 1)		
		
	local v = doCreateNpc(t.npc, t.pos)
		doCreatureSay(v, t.text, TALKTYPE_SAY)
		addEvent(doCreatureSay(v, t.text1, TALKTYPE_SAY), 5000, v)
		addEvent(doRemoveCreature, 9000, v)
		
		
	local f = doCreateNpc(t.npc1, t.pos1)
		addEvent(doCreatureSay(f, t.text2, TALKTYPE_SAY), 3000, f)		
		addEvent(doCreatureSay(f, t.text3, TALKTYPE_SAY), 6500, f)	
		addEvent(doRemoveCreature, 9000, f)
		
		
	end
end

So basically. Does anyone know how to set up the addEvent with the doCreatureSay function?

Thanks for reading!
 
Lua:
addEvent(function, time, parameters)

for example.

Lua:
addEvent(doCreatureSay, 4 * 1000, cid, "Hello world.", TALKTYPE_SAY)
 
Back
Top