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

You advanced from Level 12 to Level 120.

tobias89

Pikaz Liek Pikaz
Joined
Apr 24, 2010
Messages
110
Reaction score
0
How do i change it to be:

You advanced from Level 19 to Level 20. (Start up level) Allways 20!

How do i edit this ?
 
Il try agian..

Im trying to make my own server, only for me and my friends.
and everytime i login, or make a new char it says you advanced from level 12 to 120.

I would love to change this to 19 - 20.
 
nvm..


Code:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
	end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	return true
end
 
Last edited:
Show creaturescripts.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>

<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
	<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
	<event type="login" name="Lowlevellock" event="script" value="lowlevellock.lua"/>
	<event type="kill" name="FragReward" event="script" value="fragreward.lua"/>

	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>

	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>

<event type="death" name="DeathBroadcast" script="deathBroadcast.lua"/>
<event type="login" name="SlotLogin" script="slot.lua"/>
</creaturescripts>
 
Last edited:
<event type="login" name="Lowlevellock" event="script" value="lowlevellock.lua"/>

find that file in scripts, and edit where it says <120 change it to 20

that means a player cannot go below level 20.
 
Last edited:
<event type="login" name="Lowlevellock" event="script" value="lowlevellock.lua"/>

find that file in scripts, and edit where it says <120 change it to 20

that means a player cannot go below level 20.


I did.. It worked for the acc maker. (1/1)...

but not for the normal characters, and I mean the characters I just made.
 
This is all the scripts i can think of right now.




lowlevellock.Lua
Code:
function onLogin(cid)

	if getPlayerLevel(cid) < 120 then
	doPlayerAddExperience(cid, (getExperienceForLevel(120) - getPlayerExperience(cid)))
end
return TRUE
end

login.lua
Code:
local config = {
	loginMessage = getConfigValue('loginMessage'),
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
	local loss = getConfigValue('deathLostPercent')
	if(loss ~= nil) then
	if getPlayerName(cid) ~= "Account Manager" then
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
		doPlayerAddBlessing(cid, 1)
		doPlayerAddBlessing(cid, 2)
		doPlayerAddBlessing(cid, 3)
		doPlayerAddBlessing(cid, 4)
		doPlayerAddBlessing(cid, 5)
		doPlayerAddPremiumDays(cid, 2)
		doPlayerSetPromotionLevel(cid, 1)
	end
end

	local accountManager = getPlayerAccountManager(cid)
	if(accountManager == MANAGER_NONE) then
		local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
		if(lastLogin > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
			str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
		else
			str = str .. " Please choose your outfit."
			doPlayerSendOutfitWindow(cid)
		end

		doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
	elseif(accountManager == MANAGER_NAMELOCK) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
	elseif(accountManager == MANAGER_ACCOUNT) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
	end

	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	end

	registerCreatureEvent(cid, "Mail")
	registerCreatureEvent(cid, "GuildMotd")

	registerCreatureEvent(cid, "Idle")
	if(config.useFragHandler) then
		registerCreatureEvent(cid, "SkullCheck")
	end

	registerCreatureEvent(cid, "ReportBug")
	registerCreatureEvent(cid, "AdvanceSave")
	registerCreatureEvent(cid, "FragReward")
	return true
end



levelrebalance.lua
Code:
function onLogin(cid)
local rebalanceStor = getPlayerStorageValue(cid, 37454)

	if rebalanceStor == -1 and getPlayerLevel(cid) >= 140 then
        doPlayerAddExperience(cid, (getExperienceForLevel(130) - getPlayerExperience(cid)))
	setPlayerStorageValue(cid, 37454, 1)

	elseif rebalanceStor == -1 and getPlayerLevel(cid) > 125 and getPlayerLevel(cid) < 130 then
	doPlayerAddExperience(cid, (getExperienceForLevel(125) - getPlayerExperience(cid)))
	setPlayerStorageValue(cid, 37454, 1)

	elseif rebalanceStor == -1 and getPlayerLevel(cid) < 120 then
	doPlayerAddExperience(cid, (getExperienceForLevel(120) - getPlayerExperience(cid)))
	setPlayerStorageValue(cid, 37454, 1)
	
	else setPlayerStorageValue(cid, 37454, 1)

end
return TRUE
end
 
LUA:
function onLogin(cid)

	if getPlayerLevel(cid) < 20 then
	doPlayerAddExperience(cid, (getExperienceForLevel(20) - getPlayerExperience(cid)))
end
return TRUE
end

this means if a player goes below level 20 when he logs in he will have level 20 again
 
Back
Top