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

Bugged Script?

hallabackkid101

New Member
Joined
Feb 7, 2009
Messages
100
Reaction score
0
Location
Georgia, Usa
Does anyone see anything wrong with this? Its not working for me. I have put it in login.lua, creatureevents.xml, etc.

PHP:
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
 
Do you want a script that sets the level if he logs in? or ..? I think there are alot of better codes ex. one by Red in that case.

WibbenZ
 

Similar threads

Back
Top