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

Experience amulet (efekt znika po relogu)

Hitachi

Wyciskacz
Joined
Jan 11, 2009
Messages
19
Reaction score
0
Location
Łódź
Witam, mam taki skrypt na amulet który po użyciu zwiększa exp o X na Y czasu, ale po relogu niestety efekt znika, skrypt wygląda tak. Ciekawostką jest to, że po relogu nie można powtórnie użyć amuletu, ale exp jest normalny.

Code:
local config = {
	rate = 2.0, -- 4x More Experience
	time = 1, -- Hours of Exp Time
	storage = 20011
}
local function endExpRate(cid)
	if isPlayer(cid) == TRUE then
		doPlayerSetRate(cid, SKILL__LEVEL, 1) -- config.lua rate
		setPlayerStorageValue(cid, config.storage, -1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your extra experience time has ended.")
	end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStorageValue(cid, config.storage) < 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your extra experience rate is now: " .. config.rate .. ". It will last for ".. config.time .." hours.")
		doPlayerSetRate(cid, SKILL__LEVEL, config.rate)
		setPlayerStorageValue(cid, config.storage, os.time() + config.time * 3600)
		addEvent(endExpRate, config.time * 3600 * 1000, cid)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You still have extra experience time left.")
	end
	return TRUE
end

Proszę o pomoc.
 
zrób sobie nowy item i ustaw żeby zwiększał exp durationna 1h decayTo na item który klikasz i po sprawie będziesz miał amulet który będzie dawał exp rate na 1h zrób jeszcze item ze stopDuration gotowe.

Albo ogarnij coś z onLogin
 
Back
Top