Shawak
Intermediate OT User
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:
After you added it, go to
data/talkactions/scripts and create a talk.lua Paste:
How it works?
-> How to set the time ?
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:
You can add more Positions, words so:
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++ ?
Regards,
Shawak
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"/>
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, ...
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"}}
}
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"}}
}
Post errors on this theard!
I hope like it :thumbup:.
Please Rep++ ?
Regards,
Shawak
Last edited: