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

Random

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
I think, the random "plateia", and the random "msg" are wrong...
Code:
local plateia = 
{{x=1111, y=222, z=33},
{x=4444, y=666, z=77},
{x=8888, y=999, z=11},
{x=2222, y=333, z=44},
{x=5555, y=666, z=55}}

local msg = 
{"MATA!",
"PQP",
"AFF",
"LOL?",
"NOOBs"}

local funtcion plateiaArenaAreia(par)
 addEvent(plateiaArenaAreia, 100, par)
  if isInRange(getCreaturePosition(par.cid), {x=991, y=1067, z=7}, {x=1011, y=1087, z=7})
   local rn = math.random(1, 10)
    if rn > 0 and rn <= 3 then
    doSendAnimatedText(plateia[math.random(#plateia)], msg[math.random(#msg)], TEXTCOLOR_ORANGE)
   end
  end
 return TRUE
end

function onLogin(cid)
 local par = {cid=cid}
  addEvent(plateiaArenaAreia, 100, par)
 return TRUE
end
Please check? If are wrong, FIX?? ;)
:thumbup:
 
Code:
local plateia = {
	{x=1111, y=222, z=33},
	{x=4444, y=666, z=77},
	{x=8888, y=999, z=11},
	{x=2222, y=333, z=44},
	{x=5555, y=666, z=55}
}
local msg = {
	"MATA!",
	"PQP",
	"AFF",
	"LOL?",
	"NOOBs"
}

local function plateiaArenaAreia(cid)
	addEvent(plateiaArenaAreia, 100, cid)
	if isInRange(getThingPos(cid), {x=991, y=1067, z=7}, {x=1011, y=1087, z=7}) == TRUE then
		local rn = math.random(1, 10)
		if rn > 0 and rn <= 3 then
			doSendAnimatedText(plateia[math.random(#plateia)], msg[math.random(#msg)], TEXTCOLOR_ORANGE)
		end
	end
end

function onLogin(cid)
	plateiaArenaAreia(cid)
	return TRUE
end
 
Code:
local plateia = {
	{x=1111, y=222, z=33},
	{x=4444, y=666, z=77},
	{x=8888, y=999, z=11},
	{x=2222, y=333, z=44},
	{x=5555, y=666, z=55}
}
local msg = {
	"MATA!",
	"PQP",
	"AFF",
	"LOL?",
	"NOOBs"
}

local function plateiaArenaAreia(cid)
	addEvent(plateiaArenaAreia, 100, cid)
	if isInRange(getThingPos(cid), {x=991, y=1067, z=7}, {x=1011, y=1087, z=7}) == TRUE then
		local rn = math.random(1, 10)
		if rn > 0 and rn <= 3 then
			doSendAnimatedText(plateia[math.random(#plateia)], msg[math.random(#msg)], TEXTCOLOR_ORANGE)
		end
	end
end

function onLogin(cid)
	plateiaArenaAreia(cid)
	return TRUE
end

Can you check:
Code:
plateia[math.random(#plateia)], msg[math.random(#msg)]

?
 
Back
Top