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

[Global Events] Easier goGoGo Script!

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,393
Reaction score
52
Location
Tibia VS RL-life, guess whos back?
Hello, i made a easir script of goGoGo script which was posted by kokorec.

PS: This script works only for 0.3!


I've worked on it not long 5 minutes, but i had problem
with couldn't execute event :p

I found that problem just put a return TRUE before the end:p

What it does?

Text appear on a tile everysecond.
A Magic effect too.

This are using math.random so there will be random effect;)


Here is it;)

Create a new file in data/globalevents/script name it text.lua.
Open it and paste in this.
PHP:
function onThink(interval, lastExecution)

local pos = {x=91, y=125, z=7}
local text = "Test"
local color = math.random (1, 215)
local effect = math.random (2, 16)

doSendAnimatedText(pos, text, color)
doSendMagicEffect(pos, effect)

return TRUE
end

Now go to your data/globalevents/globalevents.xml
Write this line.

PHP:
<globalevent name="event" interval="1" script="text.lua"/>

Dont forget!

Interval = 1 = 1 Second.
Pos = which pos the text should appear.

Liked it?

rep++
 
Last edited:
Hmm, I've never heard of "onThink".. Ima take a look in it.


EDIT:

I couldn't find onThink in the function list, what does it do?
 
Do you want to improove it? :)

Make a poison chamber script :) That makes random poison effects in a 5x5 sqm area.

Thoose who enters and gets hitted by a poison effect, will loose health, might get poison, but launched through a special script so we can choose ourseless how powerful :)

By the way, I think this works on 0.2 as well.
 
Last edited:
how to make it work for 0.2!

add in creaturescripts/scripts
PHP:
function onThink(cid, interval)

local pos = {x=91, y=125, z=7}
local text = "Test"
local color = math.random (1, 215)
local effect = math.random (2, 16)

doSendAnimatedText(pos, text, color)
doSendMagicEffect(pos, effect)

return TRUE
end

in creaturescripts.xml
add
PHP:
<event type="think" name="Think" script="file.lua"/>

Should work
 
how to make it work for 0.2!

add in creaturescripts/scripts
PHP:
function onThink(cid, interval)

local pos = {x=91, y=125, z=7}
local text = "Test"
local color = math.random (1, 215)
local effect = math.random (2, 16)

doSendAnimatedText(pos, text, color)
doSendMagicEffect(pos, effect)

return TRUE
end

in creaturescripts.xml
add
PHP:
<event type="think" name="Think" script="file.lua"/>

Should work

Creaturescripts is not same as globalevents >.>

onThink in creaturescript is executed on registered creatures, that's why cid is parameter, and it would cause it to do too many animations in a second :)
 
Of course it won't work because in creaturescripts every creature 'think', and on globalevents only server. ex. 50 players online = 50 'onThink' events. Quess how it will look :)
 
Creaturescripts is not same as globalevents >.>

onThink in creaturescript is executed on registered creatures, that's why cid is parameter, and it would cause it to do too many animations in a second :)

I know, but at least it does show something ;> (even if it shows a bit to much)
 
Back
Top