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

how to add Globalevents?

lillen128

New Member
Joined
Mar 3, 2009
Messages
12
Reaction score
0
Hi i have a Roxor server based on TFS v0.2.5, The problem is that i dont know how to add Globalevents!! help please
 
I want to add like a text that will come up on the specific x: y: and z:, and i only find tuts on how to add it with globalevents :S
 
i am sure this will work in creature event . But it will be spammed.\
Lua:
local places = { ["Temple!"] = {pos = {x = 93, y= 125,z= 7},effect = 23},
                 ["depot!"] = {pos = {x = 93, y= 126,z= 7}, effect = 4}
				}
function onThink(cid,interval)
for k, v in pairs(places) do
 doSendAnimatedText(v.pos, k, math.random(1,255))
 doSendMagicEffect(v.pos,v.effect)
 end
 return true
 end
 
I cant get it to work i make a lua file in creaturescripts/scripts/animatedtext.lua

local places = { ["Temple!"] = {pos = {x = 93, y= 125,z= 7},effect = 23},
["depot!"] = {pos = {x = 93, y= 126,z= 7}, effect = 4}
}
function onThink(cid,interval)
for k, v in pairs(places) do
doSendAnimatedText(v.pos, k, math.random(1,255))
doSendMagicEffect(v.pos,v.effect)
end
return true
end

and then i add
<event type="anitext" name="Animatedtext" script="animatedtext.lua"/>
in creaturescripts/creaturescripts.xml
 
Last edited:
I cant get it to work i make a lua file in creaturescripts/scripts/animatedtext.lua

Code:
local places = { ["Temple!"] = {pos = {x = 93, y= 125,z= 7},effect = 23},
                      ["depot!"] = {pos = {x = 93, y= 126,z= 7}, effect = 4}
                                          }
function onThink(cid,interval)
for k, v in pairs(places) do
doSendAnimatedText(v.pos, k, math.random(1,255))
doSendMagicEffect(v.pos,v.effect)
end
return true
end

and then i add
Code:
 <event type="anitext" name="Animatedtext" script="animatedtext.lua"/>
in creaturescripts/creaturescripts.xml

use
Code:
[./CODE] :)
delete the script :)
 
i dont understand, what should stand in " <event type="<-->"", and should i place the script (creaturescripts/scripts/animatedtext.lua) in the login.lua?
 
you need to go to creature script and make new lua and paste the script i gave you then

go to creature--> creature.xml and paste
Code:
<event type="think" name="t" event="script" value="xxxxx.lua"/>
just put the name of script in that "xxxx" part and leave evry thing as it is
then go to creature--> scripts-->login.lua and paste this before the last return true
Code:
	registerCreatureEvent(cid, "t")
 
Back
Top