kokokoko
Veteran OT User
- Joined
- Feb 4, 2008
- Messages
- 921
- Reaction score
- 257
!NOT TESTED!
Note: This only works on servers that has doPlayerSetLossPercent(). The latest TFS(and some older versions of it) has it.
I have seen this in alot of servers i have played. Someone logs in, plays some and thinks the OT is ok. A minute later they die, and go "#¤¤%(¤%( I QUITZ!". So, i got the idea to make players under level X lose no items, skills or level.
Make a new file in creaturescripts/scripts. Name it starterDeath.lua
Add this to it:
In creaturescripts.xml, add this:
To-do list:
*Player can teleport to where he died once(Only if he is under level 10).
It should work
Note: This only works on servers that has doPlayerSetLossPercent(). The latest TFS(and some older versions of it) has it.
I have seen this in alot of servers i have played. Someone logs in, plays some and thinks the OT is ok. A minute later they die, and go "#¤¤%(¤%( I QUITZ!". So, i got the idea to make players under level X lose no items, skills or level.
Make a new file in creaturescripts/scripts. Name it starterDeath.lua
Add this to it:
Code:
function onLogin(cid)
level = 10 --Level to start losing items and levels
if getPlayerLevel(cid) < level then
for i = 0, 4 do
doPlayerSetLossPercent(cid, i, 0)
end
end
return TRUE
end
function onAdvance(cid, skill, oldlevel, newlevel)
local configloss = getConfigValue('deathLostPercent')
if newlevel == 10 then
for i = 0, 4 do
doPlayerSetLossPercent(cid, i, configloss*10)
end
end
return TRUE
end
In creaturescripts.xml, add this:
Code:
<event type="advance" name="starterDeath" script="starterDeath.lua"/>
<event type="login" name="starterDeath2" event="script" value="starterDeath.lua"/>
To-do list:
*Player can teleport to where he died once(Only if he is under level 10).
It should work