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

Text on screen

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
Hi, I have seen in servers that they can put a text in above of a teleport saying for example: "demons!" and I would like to know how can I do that. Thanks
If you need more informaton ask me. Repp++
 
Make a globalevent script over the teleport
Name this effect.lua
Code:
local config = {
positions = {
["Trainers"] = { x = 32372, y = 32243, z = 7 },

},

effects = {
CONDITION_PARAM_DELAYED



}
}

function onThink(cid, interval, lastExecution)
for text, pos in pairs(config.positions) do
doSendMagicEffect(pos, math.random(1, #config.effects))
doSendAnimatedText(pos, text, math.random(1, 255))
end

return TRUE
end
Add to globalevents:
Code:
     <globalevent name="EffectTile" interval="3000" script="effect.lua"/>

Took me 2 seconds to find.
 
PHP:
	local text = {
	--X pos,Y pos, Z pos, text
	[1] = {pos = {100,100,7}, text = {"Demons!"}},
	[2] = {pos = {100,100,7}, text = {"Other"}}
	}
 
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(18))
	end
	return TRUE
end
PHP:
	<globalevent name="effects" interval="1" event="script" value="effects.lua"/>

Code:
doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random[COLOR="#FF0000"](18))[/COLOR]
 
This has an optional feature, only text, only effect, or both.

Lua:
true / false
Good luck. ;)

Lua:
local t = {
	["Depot"] = {
		{x = 100, y = 100, z = 7}, text = true, effect = true
	},
}

function onThink(cid, interval)
	for i, v in pairs(t) do
		if v.text then
			doSendAnimatedText(v[1], i, math.random(1, 18))
		end
		
		if v.effect then
			doSendMagicEffect(v[1], math.random(CONST_ME_LAST))
		end
	end
	-- Script by J.Dre --
	return true
end
 
PHP:
	local text = {
	--X pos,Y pos, Z pos, text
	[1] = {pos = {100,100,7}, text = {"Demons!"}},
	[2] = {pos = {100,100,7}, text = {"Other"}}
	}
 
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(18))
	end
	return TRUE
end
PHP:
	<globalevent name="effects" interval="1" event="script" value="effects.lua"/>

Code:
doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random[COLOR="#FF0000"](18))[/COLOR]


?????'
 
could you explain me to use it because it didnt work knight god because anyone of the script work, probably because I dont know how, so please give me a little intructions =)
 
Open notebook and add V and save in the name of effects.lua

PHP:
local text = {
    --X pos,Y pos, Z pos, text
    [1] = {pos = {100,100,7}, text = {"Demons!"}},
    [2] = {pos = {100,100,7}, text = {"Other"}}
    }
 
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(18))
    end
    return TRUE
end

Now, go to the folder Data/globalevents/globalevents.xml and add this line.

PHP:
<globalevent name="effects" interval="1" event="script" value="effects.lua"/>
and ready.
 
1. Go To the Folder Globalevents then script make new file effectile.lua and insert this

Lua:
local timespeed = 2000 -- 2000 = 2 seconds
local color = TEXTCOLOR_LIGHTGREEN

function loop(valores)
doSendAnimatedText({x=496, y=506, z=7},"Demons!",color)
addEvent(loop, timespeed, valore) -- 
end

function onSay(cid, words, param)
valore = {cid = cid, topos = topos}
addEvent(loop, velocidade, valore)
end


edit positions and names..

2.Go To ´globalevents.xml and insert this
Lua:
<globalevent name="EffectTile" interval="3" script="effectile.lua"/>
 
Last edited:
Lua:
	local text = {

	-- Insert Location Name Here --
	-- Pos: The position of the teleport.. x,y,z --
	-- Text: The text you want to show above the teleport.. --
	
	[1] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	[2] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	[3] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	[4] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	[5] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	[6] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	[7] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	[8] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	[9] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	[10] = {pos = {xxx,xxx,x}, text = {"xxx"}},
	}
 
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
	return TRUE
end
 
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/effectile.lua:eek:nThink
luaDoSendAnimatedText(). Deprecated function.
stack traceback:
[C]: in function'doSendAnimatedText'
data/globalevents/scripts/effecile.lua:21:in function <data/globalevents/scripts/effectile:19>
 
Sir, how are you using 0.4?

Edit: I don't think 0.2.11 use "Deprecated function" error message.
Edit2: Hmm not like I care anyways, you cannot use doSendAnimatedText with 8.72+.
 
Back
Top Bottom