TalkAction Terror command for GM's :)

Colandus

Advanced OT User
Joined
Jun 6, 2007
Messages
2,424
Best answers
18
Reaction score
165
Location
Sweden
This is funny command I made to terror my players hueahuea :D

First you need these functions: Sleep function, Position function
Then go to data/talkactions/talkactions.xml and write:
Code:
<talkaction words="/terror" access="4" script="terror.lua"/>
And in data/talkactions/scripts make file called "terror.lua" and in it paste this code:
Code:
-- /terror text
local messageAmount = 40

function onSay(cid, words, param)
	if isPlayerGhost(cid) == TRUE then
		enableSleep(function()
			local tmpPos = {}
			local i = 0
			for j = 1, messageAmount * 5 do -- instead of while (for safety)
				local center = getCreaturePosition(cid)
				local pos = Position(math.random(center.x - 7, center.x + 7), math.random(center.y - 5, center.y + 5), center.z, 1)
				local thing = getTileThingByPos(pos)
				if thing.uid > 0 then
					if isCreature(thing.uid) == TRUE or hasProperty(thing.uid, CONST_PROP_BLOCKINGANDNOTMOVEABLE) == FALSE and not comparePos(tmpPos, pos) then
						i = i + 1
						tmpPos = pos
						sleep(math.random(300, 700))
						doCreatureSay(cid, param, TALKTYPE_SAY, pos)
					end
				end
				
				if i == messageAmount then
					break
				end
			end
		end)
	else
		doPlayerSendCancel(cid, "This command is only available while in ghost mode.")
	end
	return TRUE
end

Have fun terrorizing your players,
Colandus
 
Last edited:

Azi

Banned User
Joined
Aug 12, 2007
Messages
1,167
Best answers
0
Reaction score
51
Location
Włocławek
nice cola... coca cola ;D

you will be responsible for heart attacks by the tibia!
 

GMNino

New Member
Joined
Jun 30, 2007
Messages
116
Best answers
0
Reaction score
2
dont work for me i use 0.2 and add slep funtion and position, in console dont see any error but dont work.
 

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Best answers
0
Reaction score
101
Location
Brazil
ahaha funny!

doCreatureSay(cid, param, TALKTYPE_SAY, pos)
pos on doCreatureSay, i did not know that he was possible o0
 
OP
Colandus

Colandus

Advanced OT User
Joined
Jun 6, 2007
Messages
2,424
Best answers
18
Reaction score
165
Location
Sweden
Your GM need to be invisible when you execute the command.
 

GMNino

New Member
Joined
Jun 30, 2007
Messages
116
Best answers
0
Reaction score
2
yes, im in mode /ghost but dont work
 

Swimmi

♥Inactive♥
Joined
Jan 15, 2008
Messages
791
Best answers
0
Reaction score
2
Location
Germany
[26/02/2009 02:59:05] data/talkactions/scripts/terror.lua:6: attempt to call global 'enableSleep' (a nil value)
[26/02/2009 02:59:05] stack traceback:
[26/02/2009 02:59:05] data/talkactions/scripts/terror.lua:6: in function <data/talkactions/scripts/terror.lua:4>
 
OP
Colandus

Colandus

Advanced OT User
Joined
Jun 6, 2007
Messages
2,424
Best answers
18
Reaction score
165
Location
Sweden
It's good to read the instructions.
 

GMNino

New Member
Joined
Jun 30, 2007
Messages
116
Best answers
0
Reaction score
2
dont work for me im in mode ghost..
 
OP
Colandus

Colandus

Advanced OT User
Joined
Jun 6, 2007
Messages
2,424
Best answers
18
Reaction score
165
Location
Sweden
It's a funny thing to confuse players :p
 

Mikuch

/home/mikuch
Joined
Jul 1, 2008
Messages
440
Best answers
0
Reaction score
1
Location
Poland/Kielce
strange its not working at 0.3.1pl2 logs dont give any errors i added functions
my command is
PHP:
/terror MUHAHAHA
 

Zoriath

New Member
Joined
Mar 26, 2008
Messages
1,496
Best answers
0
Reaction score
3
@up

It spams a message all around a player :p
 
Top