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

TalkAction Talking Signs/Tps/Tiles for 0.2+

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,984
Solutions
2
Reaction score
119
Location
Germany
GitHub
Shawak
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:
why it has text limit, i put
Lua:
    [1] = {pos = {423,501,7}, text = {"abcdefghijklmnoprstuwxyz"}},
it shows only "abcdefghi" ... , ex. i want Trainer Island ...
 
erm.. one question, this should be in globalevents should'nt it? Why did you do a talkaction script lol :| ?
 
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>
 
Back
Top