• 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 Exp bonus

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
Hello the script aint working well if player doesnt have party even on he gets insane exp and it gets doubled every same monster kill can someone fix it please :)


PHP:
function onCombat(cid, target)
local pid = isInParty(cid)
local exp = 1.0
if pid ~= false then
end
local _v = getPlayerRates(cid)[SKILL__LEVEL]
if pid ~= true and getConfigValue("EnableExtraPartyEXP") == true then
doPlayerSetRate(cid, SKILL__LEVEL, (_v+exp))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are currently gaining more experince due to being in a party.")
end
return true
end
 
There is this.
Code:
if pid ~= false then
end
But there is nothing between the if statement and end.
~= means "is not", so atm it checks if isInParty isn't false, so true (in a party), then nothing happens (like that code part isn't there).
If isInParty isn't true, so false (not in a party), then the exp rate is changed and players get that message when they do a combat/attack.
The rate is x what a person normally gets as experience. For example if it's 2, a player gets instead of 1000 exp, 2000 exp, with 3 the player will get 3000 exp.
Atm the rate goes up with 1 every time the player does a combat, so after 5 combats the rate is 5 and the player will get 5000 exp instead of 1000.
So you can just use the rate you want in doPlayerSetRate instead of _v+exp and if a player isn't in a party set it to 1.
 
Back
Top