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

GlobalEvent Talking Tp/signs/tiles for TFS 0.3+

I edited the script a bit (So you can set a textcolor for each position also), I used it like that:

Code:
        local text = {
        [1] = {pos = {100,100,7}, text = {"Town1"}, color = {TEXTCOLOR_GREEN}},
        [2] = {pos = {100,100,7}, text = {"Town2"}, color = {TEXTCOLOR_GREEN}},
        [3] = {pos = {100,100,7}, text = {"Town3"}, color = {TEXTCOLOR_GREEN}}
        }

        local effects = {
        [1] = {pos = {100,100,7}, effect = {CONST_ME_MAGIC_RED}},
        [2] = {pos = {100,100,7}, effect = {CONST_ME_MAGIC_RED}},
        [3] = {pos = {100,100,7}, effect = {CONST_ME_MAGIC_RED}}
        }

function onThink(interval, lastExecution)
        for _, area in pairs(text) do
                doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], area.color[1])
        end
        for _, area in pairs(effects) do
                doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
        end
        return TRUE
end
Tested on TFS 0.3.6pl1
 
I edited the script a bit (So you can set a textcolor for each position also), I used it like that:

Code:
        local text = {
        [1] = {pos = {100,100,7}, text = {"Town1"}, color = {TEXTCOLOR_GREEN}},
        [2] = {pos = {100,100,7}, text = {"Town2"}, color = {TEXTCOLOR_GREEN}},
        [3] = {pos = {100,100,7}, text = {"Town3"}, color = {TEXTCOLOR_GREEN}}
        }

        local effects = {
        [1] = {pos = {100,100,7}, effect = {CONST_ME_MAGIC_RED}},
        [2] = {pos = {100,100,7}, effect = {CONST_ME_MAGIC_RED}},
        [3] = {pos = {100,100,7}, effect = {CONST_ME_MAGIC_RED}}
        }

function onThink(interval, lastExecution)
        for _, area in pairs(text) do
                doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], area.color[1])
        end
        for _, area in pairs(effects) do
                doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
        end
        return TRUE
end
Tested on TFS 0.3.6pl1

First of all, don't remove people's credits, secondly, optimized:
Lua:
--[[ 
        Talking Tp/signs/tiles for TFS 0.3+
        by Maxi (Shawak)
]]--

        local talk = {
        --X pos,Y pos, Z pos, text, effect
        [1] = {pos = {1095,1217,7}, text = {"text 1"}, color = {TEXTCOLOR_GREEN}, effect = {18}},
        [2] = {pos = {1096,1217,7}, text = {"text 2"}, color = {TEXTCOLOR_GREEN}, effect = {19}},
        [3] = {pos = {1097,1217,7}, text = {"text 3"}, color = {TEXTCOLOR_GREEN}, effect = {21}},
        [4] = {pos = {1098,1217,7}, text = {"text 4"}, color = {TEXTCOLOR_GREEN}, effect = {22}}
        }

function onThink(interval, lastExecution)
        for _, area in pairs(talk) do
                doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], area.color[1])
		doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
        end
        return TRUE
end
 
Last edited by a moderator:
Code:
local t = {
	[{x=1095, y=1217, z=7}] = {text = 'text 1', color = TEXTCOLOR_GREEN, effect = 18},
	[{x=1096, y=1217, z=7}] = {text = 'text 2', color = TEXTCOLOR_GREEN, effect = 19},
	[{x=1097, y=1217, z=7}] = {text = 'text 3', color = TEXTCOLOR_GREEN, effect = 21},
	[{x=1098, y=1217, z=7}] = {text = 'text 4', color = TEXTCOLOR_GREEN, effect = 22}
}
function onThink(interval, lastExecution, thinkInterval)
	for pos, v in pairs(t) do
		if v.text then
			doSendAnimatedText(pos, v.text, v.color or math.random(255))
		end
		if v.effect then
			doSendMagicEffect(pos, v.effect)
		end
	end
	return true
end
 
First of all, don't remove people's credits, secondly, optimized:
Lua:
--[[ 
        Talking Tp/signs/tiles for TFS 0.3+
        by Maxi (Shawak)
]]--

        local talk = {
        --X pos,Y pos, Z pos, text, effect
        [1] = {pos = {1095,1217,7}, text = {"text 1"}, color = {TEXTCOLOR_GREEN}, effect = {18}},
        [2] = {pos = {1096,1217,7}, text = {"text 2"}, color = {TEXTCOLOR_GREEN}, effect = {19}},
        [3] = {pos = {1097,1217,7}, text = {"text 3"}, color = {TEXTCOLOR_GREEN}, effect = {21}},
        [4] = {pos = {1098,1217,7}, text = {"text 4"}, color = {TEXTCOLOR_GREEN}, effect = {22}}
        }

function onThink(interval, lastExecution)
        for _, area in pairs(talk) do
                doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], area.color[1])
		doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
        end
        return TRUE
end


Why the fuck should I add the credits in the script, when I told you above my the script, that I edited the original, so you can be sure the script is not stolen.
 
Why the fuck should I add the credits in the script, when I told you above my the script, that I edited the original, so you can be sure the script is not stolen.

What do you mean add credits? They shouldn't have been taken out in the first place.
 
how to remove the "sing" animation and only have the Text message?
 
Im getting this message...
Code:
19] [Error - LuaScriptInterface::loadFile] data/globalevents/scripts/effects.lua:9: unexpected symbol near '['
[10/08/2010 19:16:19] [Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/effects.lua)
[10/08/2010 19:16:19] data/globalevents/scripts/effects.lua:9: unexpected symbol near '['

Heres the script
Code:
--[[ 
	Talking Tp/signs/tiles for TFS 0.3+
	by Maxi (Shawak)
]]--
 
	local text = {
	--X pos,Y pos, Z pos, text
	[1] = {pos = 152,43,7}, text = {"Depot"}},
	[2] = {pos = 153,43,7}, text = {"Sanfar"}},
	[3] = {pos = 154,43,7}, text = {"Falighart"}},
	[4] = {pos = 155,43,7}, text = {"Thais"}},
	[5] = {pos = 156,43,7}, text = {"Blood Bay"}},
	[6] = {pos = 157,43,7}, text = {"Zaoan Island"}}
	}
 
	local effects = {
	--X pos,Y pos, Z pos, text
	[1] = {pos = {152,43,7}, effect = {18}},
	[2] = {pos = {153,43,7}, effect = {19}},
	[3] = {pos = {154,43,7}, effect = {21}},
	[4] = {pos = {155,43,7}, effect = {22}},
	[5] = {pos = {156,43,7}, effect = {23}},
	[6] = {pos = {157,43,7}, effect = {24}}
	}
 
function onThink(interval, lastExecution)
	for _, area in pairs(text) do
		doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random(01,255))
	end
	for _, area in pairs(effects) do
		doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
	end
	return TRUE
end

Whats wrong?
 
What do I put in globalevents.xml using TF2 0.4?

Because it says the event does not exist.
 
Last edited:
Back
Top