• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Onlogin give ML

Ghazer

Member
Joined
Mar 13, 2009
Messages
350
Reaction score
6
How I can create script with this features...
only if sorcerer/master druid/elder add magic level 60 onlogin?

- - - Updated - - -

I create that:

LUA:
function onLogin(cid)
    if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
    doPlayerAddMagLevel(cid, 60)
    getPlayerStorageValue(cid, 56364)
end
    return true
end

That work but give freeze on first login
 
Last edited:
Made by is functions script or You go see console any error have?, I edit Your Script here u go:
not tested..
LUA:
function onLogin(cid)
local magLevel = getPlayerMagLevel(cid)
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 and magLevel < 60 then
doPlayerAddMagLevel(cid, 60)
getPlayerStorageValue(cid, 56364)
end
return TRUE
end
 
Don't understand you want
quest magic level or Onlogin?
why i can script quest for you ,only one time, other times not only first added magic level?.
 
I only want druids and sorcerers start with ML 60... I want do it with quest or login, but two options give me a freeze... On first login have freeze and onfirst use chest have freeze

- - - Updated - - -

That give a freeze because add magic level one by one...
I create that script, can you check?
LUA:
function onLogin(cid)
    if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
	    doRemoveCreature(cid
        db.query('UPDATE `players` SET `mag_level` = 60 WHERE `name` = ' .. getPlayerName(cid) .. ';')
        getPlayerStorageValue(cid, 56364)
    end
    return true
end
 
Back
Top