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

Lua Problem with my level script

Sategat

New Member
Joined
May 25, 2009
Messages
113
Reaction score
0
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemuid == 9880 and getPlayerStorageValue(cid, 3453) == 0 and getPlayerLevel(cid) < 80 then
doPlayerAddExperience(cid, (getExperienceForLevel(80) - getPlayerExperience(cid)))
return true
else

doPlayerSendTextMessage(cid, 22, 'you can not do this quest')

return false
end
end

Hello, i have a problem with this script, it's my first script, did i do something wrong? It only gives me the message "You can not do this quest"

thank you.
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 9880 and getPlayerStorageValue(cid, 3453) == 0 and getPlayerLevel(cid) < 80 then
		doPlayerAddExperience(cid, (getExperienceForLevel(80) - getPlayerExperience(cid)))
	else
		doPlayerSendTextMessage(cid, 22, 'you can not do this quest')
	end
	return true
end
 
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 9880 and getPlayerStorageValue(cid, 3453) == 0 and getPlayerLevel(cid) < 80 then
		doPlayerAddExperience(cid, (getExperienceForLevel(80) - getPlayerExperience(cid)))
	else
		doPlayerSendTextMessage(cid, 22, 'you can not do this quest')
	end
	return true
end

Remove the item check, it is useless.
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 9853) == 0 and getPlayerLevel(cid) < 80 then
	
	doPlayerAddExperience(cid, (getExperienceForLevel(80) - getPlayerExperience(cid)))
	doPlayerSetStorageValue(uid, 9853, 1)
	else
	
	
	doPlayerSendTextMessage(cid, 22, 'You cannot do this quest anymore')
	end
	return true
	end


Well, it works ok, but it doesn't give me the exp, is anything wrong with the doPlayerAddExperience function ?
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 9853) == 1 and getPlayerLevel(cid) < 80 then	
	doPlayerAddExperience(cid, (getExperienceForLevel(80) - getPlayerExperience(cid)))
	doPlayerSetStorageValue(uid, 9853, 1)
	else
	doPlayerSendTextMessage(cid, 22, 'You cannot do this quest anymore')
	end
	return true
	end
 
Back
Top