TalkAction Talking Signs/Tps/Tiles for 0.2+

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
Talking Signs/Tps/Tiles for 0.2.4

Commands:
!talk "on --> Tiles start to say your text(s).
!talk "off --> Tiles stop to say your text(s).

How to install?
Go to data/talkactions/talkactions.xml and add:
PHP:
	<talkaction log="yes" access="3" words="!talk" event="script" value="talk.lua"/>
After you added it, go to
data/talkactions/scripts and create a talk.lua Paste:
PHP:
--[[ 
	Talking Tp/signs/tiles for TFS 0.2+
	60% by Marki, 40% by Shawak
	Idea by Shawak
]]--

	local time = 2    -- 1 = 1 sec, 2 = 2 sec, ...

	local config = {
	--X pos,Y pos, Z pos, text
	[1] = {pos = {132,93,7}, text = {"Test 1"}},
	[2] = {pos = {133,93,7}, text = {"Test 2"}}
	}      
	
	local say_events = {}

local function SayText(cid)
	if isPlayer(cid) == TRUE then
	     if say_events[getPlayerGUID(cid)] ~= nil then
		     for _, area in pairs(config) do
			     doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random(01,255))
		     end
		     say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000 / 2, cid)       
          end                                                       
	end
	return TRUE
end

function onSay(cid, words, param, channel) 
	if param == "on" then
		for _, area in pairs(config) do
			doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random(01,255))
		end
		say_events[getPlayerGUID(cid)] = addEvent(SayText, time * 1000, cid)
		doPlayerSendTextMessage(cid,19,"You set the function \"SayText\" -> ON.")
	elseif param == "off" then
		stopEvent(say_events[getPlayerGUID(cid)])
		say_events[getPlayerGUID(cid)] = nil
		doPlayerSendTextMessage(cid,19,"You set the function \"SayText\" -> OFF.")
	end
	return TRUE
end

How it works?


-> How to set the time ?
PHP:
	local time = 2    -- 1 = 1 sec, 2 = 2 sec, ...
It says all 2 min the text(s)/word(s),
you can change it to whatever you want.

-> How to add more positions/words ?

This is the config:
PHP:
    local config = {
    --X pos,Y pos, Z pos, text
    [1] = {pos = {132,93,7}, text = {"Test 1"}},
    [2] = {pos = {133,93,7}, text = {"Test 2"}}
    }
You can add more Positions, words so:
PHP:
    local config = {
    --X pos,Y pos, Z pos, text
    [1] = {pos = {132,93,7}, text = {"Test 1"}},
    [2] = {pos = {133,93,7}, text = {"Test 2"}},
    [3] = {pos = {134,93,7}, text = {"Test 3"}}
    }
Don't forget to change the "[2]" to "[3]" and the "," after "text = {"Test 2 "}}"

Post errors on this theard!

I hope like it :thumbup:.
Please Rep++ :confused:?

Regards,
Shawak
 
Last edited:

Smel

[SNEL]
Joined
Jan 10, 2009
Messages
832
Best answers
0
Reaction score
2
Great script, that's very usefull.
 

Wiw3K

New Member
Joined
Apr 16, 2008
Messages
371
Best answers
0
Reaction score
3
why it has text limit, i put
Lua:
    [1] = {pos = {423,501,7}, text = {"abcdefghijklmnoprstuwxyz"}},
it shows only "abcdefghi" ... , ex. i want Trainer Island ...
 

Martiimeus

●тнυg●ℓιƒє● ρα¢ 4 єνєя
Joined
Feb 3, 2009
Messages
500
Best answers
0
Reaction score
1
Location
gєямαηу
erm.. one question, this should be in globalevents should'nt it? Why did you do a talkaction script lol :| ?
 

BeniS

Advanced OT User
Joined
Aug 8, 2009
Messages
1,850
Best answers
0
Reaction score
183
Location
New Zealand
Its not working for me...it compatible with 0.2.5? great script tho...
 

BeniS

Advanced OT User
Joined
Aug 8, 2009
Messages
1,850
Best answers
0
Reaction score
183
Location
New Zealand
Nope no errors, just doesn't work when I say !talk "on
 
OP
Shawak

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,976
Best answers
2
Reaction score
101
Location
Germany
Then it isn't compatible, sorry.
 

frits

Mapper
Joined
Jun 25, 2009
Messages
140
Best answers
0
Reaction score
0
Location
X = 18532 Y = 843521, Z = 7
Great release! i love it:wub:
Repp++ for you!

~Feel free to if my post helped you :D

----------------------------------------------------------------

 

kacpersky

Mr. Brightside
Joined
Jan 25, 2009
Messages
499
Best answers
0
Reaction score
3
Its not working for me...it compatible with 0.2.5? great script tho...
yeah it works, u have to change in talkactions:
PHP:
<talkaction log="yes" access="3" words="!talk" script="talk.lua"/>
 

Berensergen

New Member
Joined
Sep 10, 2011
Messages
44
Best answers
0
Reaction score
0
I don't mean to necro this.. but can someone help me.. I get this error : [02/01/2012 01:21:57] Lua Script Error: [TalkAction Interface]
[02/01/2012 01:21:57] in a timer event called from:
[02/01/2012 01:21:57] data/talkactions/scripts/talk.lua:eek:nSay
[02/01/2012 01:21:57] luaDoSendAnimatedText(). Deprecated function.
[02/01/2012 01:21:57] stack traceback:
[02/01/2012 01:21:57] [C]: in function 'doSendAnimatedText'
[02/01/2012 01:21:57] data/talkactions/scripts/talk.lua:15: in function <data/talkactions/scripts/talk.lua:11>
 

daboss44

New Member
Joined
Jul 4, 2010
Messages
1
Best answers
0
Reaction score
0
im getting same prob ^ anyone know whats up with this?
 
Top