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

tetra20

DD
Joined
Jan 17, 2009
Messages
1,315
Solutions
4
Reaction score
323
Location
Egypt
I Knew Much People made it before i just wanted to try my newbie skills ^_^

Code:
function onThink(interval, lastExecution)
local t = {
   [{x=1000,y=1000,z=7}] = {effect=math.random(40), text = "Hhh"},
   [{x=1000,y=1002,z=7}] = {effect=math.random(40), text = "hhs"}
   }
   for i,v in pairs(t) do
     doSendMagicEffect(i,v.effect)
     doSendAnimatedText(i,v.text, COLOR_BLUE)
   end
   return true
end

Code:
<globalevent name="effect" interval="1" event="script" value="hp.lua"/>
 
Last edited:
Lua:
function onThink(interval, lastExecution)
local t = {
    [{x=1000,y=1000,z=7}] = {effect=math.random(1,40), text = "Hhh"},
  [{x=1000,y=1002,z=7}] = {effect=math.random(1,40), text = "hhs}
}
	for i,v in pairs(t) do
        if doSendMagicEffect(i,v[1]) then
        doSendAnimatedText(i,v[2], v[1])
        end
	return TRUE
end

new edition with tables
 
Code:
function onThink(interval, lastExecution)
local t = {
   [{x=1000,y=1000,z=7}] = {effect=math.random(1,40), text = "Hhh"},
   [{x=1000,y=1002,z=7}] = {effect=math.random(1,40), text = "hhs"}
   }
   for i,v in pairs(t) do
     doSendMagicEffect(i,v.effect)
     doSendAnimatedText(i,v.text, COLOR_BLUE)
   end
   return true
end

a New Working edition :)
 
math.random(40) works the same as math.random(1,40)
 
Back
Top