D
Deleted member 49793
Guest
Can someone make the words that pop up when you login the first time into the server
Can someone make this so it pops up everytime someone logs in?
Code:
local storage = 6789
local message = 'Welcome to our server!'
function send(pos, letter, color)
return doSendAnimatedText(pos, letter, color)
end
Code:
function doChoose(...)
local arg = {...}
return arg[math.random(1, table.maxn(arg))]
end
function doSendMagicEffectInArea(pos,area) -- Function by mock
local center = {}
center.y = math.floor(table.getn(area)/2)+1
for y = 1, table.getn(area) do
for x = 1, table.getn(area[y]) do
if area[y][x] > 0 then
center.x = math.floor(table.getn(area[y])/2)+1
doSendMagicEffect({x=pos.x+x-center.x,y=pos.y+y-center.y,z= pos.z},doChoose(28,29,30),cid)
end
end
end
return true
end
local area = {
{0, 1, 1, 1, 0},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{1, 1, 1, 1, 1},
{0, 1, 1, 1, 0}
}
local advance = {
[SKILL_FIST] = {"F","I","S","T","U","P","!"},
[SKILL_CLUB] = {"C","L","U","B","U","P","!"},
[SKILL_SWORD] = {"S","W","O","R","D","U","P","!"},
[SKILL_AXE] = {"A","X","E","U","P","!"},
[SKILL_DISTANCE] = {"D","I","S","T","A","N","C","E","U","P","!"},
[SKILL_SHIELD] = {"S","H","I","E","L","D","U","P","!"},
[SKILL_FISHING] = {"F","I","S","H","I","N","G","U","P","!"},
[SKILL__MAGLEVEL] = {"M","A","G","I","C","U","P","!"},
[SKILL__LEVEL] = {"L","E","V","E","L","U","P","!"}
}
local storage = 6789
local message = 'Welcome to our server!'
function send(pos, letter, color)
return doSendAnimatedText(pos, letter, color)
end
function onAdvance(cid, skill, oldLevel, newLevel)
local data = advance[skill]
doSendMagicEffectInArea(getThingPos(cid),area)
for i = 1, #data do
addEvent(send, i * 150, getThingPos(cid), data[i], math.mod(i,2) == 0 and TEXTCOLOR_RED or TEXTCOLOR_ORANGE)
end
return true
end
function onLogin(cid)
registerCreatureEvent(cid, "advanced")
if getCreatureStorage(cid, storage) == EMPTY_STORAGE then
doPlayerPopupFYI(cid, message)
doCreatureSetStorage(cid, storage, 1)
end
return true
end