• 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 Text and Effects over teleports

Lopaz

Member
Joined
Sep 1, 2010
Messages
50
Reaction score
5
Location
https://otland.net/
Hello! I'm still pretty new here but i'll still make a tutorial to newcomers :rolleyes:.

First go to Data/Globalevents and open globalevent.xml
Here you will see: <globalevents> copy this <globalevent name="effecttile" interval="2" script="effectile.lua"/> and put it under <globalevents>
interval="2" <--- 2 means how fast the effects and text should appear. (2 = after 2s)

Then it will look like this:

XML:
<globalevents>
<globalevent name="effecttile" interval="2" script="effectile.lua"/>

When you're done with it, go to Data/Globalevents/Scripts and make a .lua file there (or you can just copy a .lua file there).
If you made a 100% new lua file, then rename it to effectile.
If the .lua is a copy, change the name of it to effectile and open it. Remove everything in it until it's empty and then press save.

Copy this script and put it in the effectile.lua:

Lua:
local config = {
	positions = {
		["text here"] = { x = xxx, y = yyy, z = z },
		["text here"] = { x = xxx, y = yyy, z = z },
	},

	effects = {
		CONST_ME_MAGIC_BLUE,
		CONST_ME_MAGIC_GREEN,
		CONST_ME_MORTAREA
	},

	colors = {
		TEXTCOLOR_WHITE,
		TEXTCOLOR_ORANGE,
		TEXTCOLOR_GREEN,
		TEXTCOLOR_BLUE
	}
}

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

positions = {
["text here"] = { x = xxx, y = yyy, z = z },
["text here"] = { x = xxx, y = yyy, z = z },

This means where the text and effect should be. Example:
["Trainers"] = { x = 1000, y = 1000, z = 7 },

Now I will explain alittle what they do.

effects = {
CONST_ME_MAGIC_BLUE,
CONST_ME_MAGIC_GREEN,
CONST_ME_MORTAREA

This means what effects that will appear on the Portal.

CONST_ME_MAGIC_BLUE, is blue sparkles
CONST_ME_MAGIC_GREEN, is green sparkles
CONST_ME_MORTAREA is sudden death

colors = {
TEXTCOLOR_WHITE,
TEXTCOLOR_ORANGE,
TEXTCOLOR_GREEN,
TEXTCOLOR_BLUE

This means what color the text on the portal should have.



If you want an unique effect for a portal, then do almost everything as I said above but make a new .lua and name it to effectileeffecthere.
Example: effectilemort
^ This one for effectile sudden death effect.
Then you go back to your effectile .lua and copy everything and put it in effectilemort.lua.
At effects, remove everything EXCEPT:
effects = {
CONST_ME_MORTAREA


Because this one is sudden death. And then you just put the position of the portal and you're done :)

Rep++ if you find this useful ^^
 
Last edited:
Tutorials on depreciated functions aren't very helpful. Thank you for contributing though.
 
What do you mean "aren't very helpful"? ^_^

He told you that won't work on newer tfs for 9.xx, cuz it's a depreciated function, so it won't work, the effect will apearmaybe buy not the texts.
 
Thanks ; P,
List of CONST_ME:
Lua:
CONST_ME_DRAWBLOOD = 0
CONST_ME_LOSEENERGY = 1
CONST_ME_POFF = 2
CONST_ME_BLOCKHIT = 3
CONST_ME_EXPLOSIONAREA = 4
CONST_ME_EXPLOSIONHIT = 5
CONST_ME_FIREAREA = 6
CONST_ME_YELLOW_RINGS = 7
CONST_ME_GREEN_RINGS = 8
CONST_ME_HITAREA = 9
CONST_ME_TELEPORT = 10
CONST_ME_ENERGYHIT = 11
CONST_ME_MAGIC_BLUE = 12
CONST_ME_MAGIC_RED = 13
CONST_ME_MAGIC_GREEN = 14
CONST_ME_HITBYFIRE = 15
CONST_ME_HITBYPOISON = 16
CONST_ME_MORTAREA = 17
CONST_ME_SOUND_GREEN = 18
CONST_ME_SOUND_RED = 19
CONST_ME_POISONAREA = 20
CONST_ME_SOUND_YELLOW = 21
CONST_ME_SOUND_PURPLE = 22
CONST_ME_SOUND_BLUE = 23
CONST_ME_SOUND_WHITE = 24
CONST_ME_BUBBLES = 25
CONST_ME_CRAPS = 26
CONST_ME_GIFT_WRAPS = 27
CONST_ME_FIREWORK_YELLOW = 28
CONST_ME_FIREWORK_RED = 29
CONST_ME_FIREWORK_BLUE = 30
CONST_ME_STUN = 31
CONST_ME_SLEEP = 32
CONST_ME_WATERCREATURE = 33
CONST_ME_GROUNDSHAKER = 34
CONST_ME_HEARTS = 35
CONST_ME_FIREATTACK = 36
CONST_ME_ENERGYAREA = 37
CONST_ME_SMALLCLOUDS = 38
CONST_ME_HOLYDAMAGE = 39
CONST_ME_BIGCLOUDS = 40
CONST_ME_ICEAREA = 41
CONST_ME_ICETORNADO = 42
CONST_ME_ICEATTACK = 43
CONST_ME_STONES = 44
CONST_ME_SMALLPLANTS = 45
CONST_ME_CARNIPHILA = 46
CONST_ME_PURPLEENERGY = 47
CONST_ME_YELLOWENERGY = 48
CONST_ME_HOLYAREA = 49
CONST_ME_BIGPLANTS = 50
CONST_ME_CAKE = 51
CONST_ME_GIANTICE = 52
CONST_ME_WATERSPLASH = 53
CONST_ME_PLANTATTACK = 54
CONST_ME_TUTORIALARROW = 55
CONST_ME_TUTORIALSQUARE = 56
CONST_ME_MIRRORHORIZONTAL = 57
CONST_ME_MIRRORVERTICAL = 58
CONST_ME_SKULLHORIZONTAL = 59
CONST_ME_SKULLVERTICAL = 60
CONST_ME_ASSASSIN = 61
CONST_ME_STEPSHORIZONTAL = 62
CONST_ME_BLOODYSTEPS = 63
CONST_ME_STEPSVERTICAL = 64
CONST_ME_YALAHARIGHOST = 65
CONST_ME_BATS = 66
CONST_ME_SMOKE = 67
CONST_ME_INSECTS = 68
CONST_ME_NONE = 255
CONST_ME_LAST = CONST_ME_INSECTS
 

Similar threads

Back
Top