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

Good Time - double exp

Krzkru

New Member
Joined
Jan 10, 2013
Messages
89
Reaction score
1
Location
Poland
searching for script - event for double exp 2-3 times a day
example:
PHP:
double exp between 5:00 - 6:00
double exp between 15:00 - 16:00
double exp between 20:00 - 21:00

and if it could give for ex. 20 points every 15 mins to 1 lucky person in this time but only exp can be.

tibia 8.6 tfs 0.3.6
 
Last edited:
First go to creaturescripts/scripts/login.lua and paste this code under: Function Onlogin(cid):
Lua:
local cyko = {
	new_rate = 2,
	old_rate = 1
}

if getStorage(3000) == 1 then
	doPlayerSetRate(cid, SKILL__LEVEL, cyko.new_rate)
	else
	doPlayerSetRate(cid, SKILL__LEVEL, cyko.old_rate)
end

Now go to globalevents/globalevents.xml and paste these lines:
XML:
<!--////////////////////////////05:00-06:00//////////////////////////////////////-->
<globalevent name="2xExp1" time="05:00" event="script" value="doubleexp.lua"/>
<globalevent name="2xExp2" time="06:00" event="script" value="doubleexp.lua"/>
<!--////////////////////////////15:00-16:00//////////////////////////////////////-->
<globalevent name="2xExp3" time="15:00" event="script" value="doubleexp.lua"/>
<globalevent name="2xExp4" time="16:00" event="script" value="doubleexp.lua"/>
<!--////////////////////////////20:00-21:00//////////////////////////////////////-->
<globalevent name="2xExp5" time="20:00" event="script" value="doubleexp.lua"/>
<globalevent name="2xExp6" time="21:00" event="script" value="doubleexp.lua"/>
<!--///////////////////////////////END///////////////////////////////////////////-->

Now go to globalevents/scripts and create new lua and name it: "doubleexp.lua" and paste this code:
Lua:
local cyko = {
	new_rate = 2,
	old_rate = 1
}

function onTimer()
	if getStorage(3000) == -1 then 
		doSetStorage(3000, 1)
		doBroadcastMessage("Double Exp event is on.")
	for _, on in ipairs(getPlayersOnline()) do
		doPlayerSetRate(on, SKILL__LEVEL, cyko.new_rate)
	end
	else
		doSetStorage(3000, -1)
		doBroadcastMessage("Double Exp event is off.")
	for _, off in ipairs(getPlayersOnline()) do
		doPlayerSetRate(off, SKILL__LEVEL, cyko.old_rate)
		end
	end
	return true
end

Enjoy!
 
Last edited:
something is wrong:

[01/03/2013 21:26:03] [Error - CreatureScript Interface]
[01/03/2013 21:26:03] data/creaturescripts/scripts/login.lua:eek:nLogin
[01/03/2013 21:26:03] Description:
[01/03/2013 21:26:03] (luaDoPlayerSetRate) Player not found
- this shown when i log on any player.

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

function onLogin(cid)

local cyko = {
	new_rate = 2,
	old_rate = 1
}
 
if getStorage(3000) == 1 then
	doPlayerSetRate(on, SKILL__LEVEL, cyko.new_rate)
	else
	doPlayerSetRate(on, SKILL__LEVEL, cyko.old_rate)
end

	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, "TopFrags")
	registerCreatureEvent(cid, "GuildMotd")

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

	registerCreatureEvent(cid, "ReportBug")
        registerCreatureEvent(cid, "fullmh")
	registerCreatureEvent(cid, "AdvanceSave")
 registerCreatureEvent(cid, "Criredric") registerCreatureEvent(cid, "Vampire Bride") registerCreatureEvent(cid, "Nifra") registerCreatureEvent(cid, "Addons") registerCreatureEvent(cid, "ReputationFromMonsters")
    	return true
end
 
Back
Top