• 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.X player dying and reseting to level 1

Lurk

Active Member
Joined
Dec 4, 2017
Messages
336
Reaction score
48
Hello, I was using this script
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == true then
if (getPlayerSlotItem(cid, 2).itemid == 10134) then
pos = getCreaturePos(cid)
doCreatureSetDropLoot(cid, false)
doPlayerSetLossPercent(cid, experience, 0)
doSendMagicEffect(pos, 49)
return TRUE
end
end
return TRUE
end
and whenever people died, they were bugging and reseting to level 1, I found another version that works but those players who wereve prviously bugged are still bugged. Every solution I found for my problem didn't work, and I know for a FACT the problem is this
doPlayerSetLossPercent(cid, experience, 0)
any idea how to turn that back to the defaulft value? I checked in my DB and every field in player that had loss isn't changed

in my config.lua I have
Lua:
deathLostPercent = 10
but whenever I tried to use
doPlayerSetLossPercent(cid, experience, 10)
it would bug anyway
 
Last edited:
Solution
Try this one and tell me if your character still gets bugged.
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == true then
if (getPlayerSlotItem(cid, 2).itemid == 10134) then
pos = getCreaturePos(cid)
doCreatureSetDropLoot(cid, false)
doPlayerSetLossPercent(cid, experience, 45)
doSendMagicEffect(pos, 49)
return TRUE
end
end
return TRUE
end
Check in your data\creaturescripts\scripts inside login.lua and see if you have
Lua:
 doPlayerSetLossPercent
Tell me the numbers there or paste it here to me and tell me in your config.lua those lines with their exact numbers or paste the whole config.lua here.
Lua:
    blessingReductionBase = 30
    blessingReductionDecrement = 5
    eachBlessReduction = 8
 
Last edited:
there's no
doPlayerSetLossPercent
in my login.lua

that part of my config.lua
Lua:
blessingOnlyPremium = false
blessingReductionBase = 30
blessingReductionDecreament = 5
eachBlessReduction = 8
 
Last edited:
Try this one and tell me if your character still gets bugged.
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == true then
if (getPlayerSlotItem(cid, 2).itemid == 10134) then
pos = getCreaturePos(cid)
doCreatureSetDropLoot(cid, false)
doPlayerSetLossPercent(cid, experience, 45)
doSendMagicEffect(pos, 49)
return TRUE
end
end
return TRUE
end
 
Solution
Cheers, You can PM me I will explain to you what I meant.
 
I just did some tests because deathlosspercent is connected with blessreduction.
I am not sure if there's anyway to calculate it without tests.
 

Similar threads

Back
Top