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

TFS 0.3.4pl1 adding ExpRate

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,766
Solutions
1
Reaction score
225
Location
Chile, Santiago
Hello!
Can someone make a login script, that when players login, and have promotion = 2 and premium days > 0, then the player experience rate will be rate +1.


Some one please, I rep!
 
You can try this, didn't have time to test it but if there's any errors post here and I'll fix them
Lua:
local newExp = 5 -- new experience rate
function onLogin(cid)
	if getPlayerPromotionLevel(cid) == 1 and getPlayerPremiumDays(cid) > 0 then
		doPlayerSetRate(cid, EXPERIENCE, newExp))
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your experience is now ..newExp.. .")
		end
	return TRUE
end
 
Last edited:
[14/11/2009 04:35:56] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/login.lua)
[14/11/2009 04:35:56] data/creaturescripts/scripts/login.lua:15: 'then' expected near '='
 
[19/11/2009 01:09:42] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/login.lua)
[19/11/2009 01:09:42] data/creaturescripts/scripts/login.lua:4: unexpected symbol near ')'


:S
 
Code:
local newExp = 5 -- new experience rate
function onLogin(cid)
	if getPlayerPromotionLevel(cid) == 1 and getPlayerPremiumDays(cid) > 0 then
		doPlayerSetRate(cid, SKILL__LEVEL, newExp)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your experience rate is now ..newExp.. .")
	end
	return TRUE
end
 
Code:
function onLogin(cid)
	if getPlayerPromotionLevel(cid) == 2 and getPlayerPremiumDays(cid) > 0 then
		doPlayerSetExtraExpRate(cid, 1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your experience rate is now " .. getPlayerRates(cid)[8] + getPlayerExtraExpRate(cid) .. ".")
	end
	return TRUE
end
 
Back
Top