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

Exp egg script

DestinationSer

@echo off
Joined
Mar 7, 2009
Messages
2,806
Solutions
1
Reaction score
676
I am requesting a exp egg script that makes you allowed to use it till you reach Second prestige.
Storage id of prestige: 85987
When you reach second prestige it comes a text "You cannot use these exp eggs anymore! You have reached second prestige or you are to high to use it"
 
Save as prestige_egg.lua
LUA:
local config {
	storage = 85987
	fap = "Your prestige level is too high"
	success = "You have reached second prestige"
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, config.storage) == 1 then
		if doRemoveItem(cid, item.uid) then
			setPlayerStorageValue(cid, storage, 2)
			doPlayerSendTextMessage(cid, 22, config.success)
		end
	else
		doSendMagicEffect(getThingPos(cid), CONST_ME_POOF)
		doPlayerSendTextMessage(cid, 22, config.fap)
	end
	return true
end
actions.xml
XML:
<action itemid="ITEMID" script="prestige_egg.lua" />
 
I mean. it should give exp so you can prestige 2 times. but at the second time it cant be used no more

LUA:
local config {
	storage = 85987
	itemstorage = 85988
	value = getPlayerStorageValue(cid, 85988)
	fap = "You\'ve already used up this items powers."
	success = "You have prestiged."
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, config.storage) == 1 and getPlayerStorageValue(cid, config.itemstorage) ~= 2 then
		if doRemoveItem(cid, item.uid) then
			setPlayerStorageValue(cid, config.storage, config.value + 1)
			setPlayerStorageValue(cid, config.itemstorage, config.value + 1)
			doPlayerSendTextMessage(cid, 22, config.success)
		end
	else
		doSendMagicEffect(getThingPos(cid), CONST_ME_POOF)
		doPlayerSendTextMessage(cid, 22, config.fap)
	end
	return true
end

Will probably fap the wrong way.
 
Last edited by a moderator:
[22/05/2012 20:27:31] [Error - LuaScriptInterface::loadFile] data/actions/scripts/other/prestige-eggs.lua:1: unexpected symbol near '{'
[22/05/2012 20:27:31] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/prestige-eggs.lua)
[22/05/2012 20:27:31] data/actions/scripts/other/prestige-eggs.lua:1: unexpected symbol near '{'
 
LUA:
local config {
	storage = 85987,
	itemstorage = 85988,
	value = getPlayerStorageValue(cid, 85988),
	fap = "You\'ve already used up this items powers.",
	success = "You have prestiged."
}
 
LUA:
local config {
	storage = 85987,
	itemstorage = 85988,
	value = getPlayerStorageValue(cid, 85988),
	fap = "You\'ve already used up this items powers.",
	success = "You have prestiged."
}

LUA:
local config = {
	storage = 85987,
	itemstorage = 85988,
	value = getPlayerStorageValue(cid, 85988),
	fap = "You've already used up this items powers.",
	success = "You have prestiged."
}

I always forget these kind of things haha. Thanks bud.
 
Last edited by a moderator:
Nice storage check outside the function

is this the same thing as rebirth? can they prestige at an NPC?
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local s = getCreatureStorage(cid, 85987)
	if s < 2 then
		local l = 717217 - getPlayerLevel(cid)
		if l == 0 then
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You're ready to prestige already.")
		else
			doRemoveItem(item.uid)
			doPlayerAddLevel(cid, l)
			doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have prestiged.")
		end
	else
		doSendMagicEffect(getThingPos(cid), CONST_ME_POOF)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You've already used up this items powers.")
	end
	return true
end
add this if you want to increase the storage value too
LUA:
doCreatureSetStorage(cid, 85987, math.max(0, s + 1))
 
Last edited:
Back
Top