• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[TFS 1.1x] deathPenalty function for Whi World.

whitevo

Feeling good, thats what I do.
Joined
Jan 2, 2015
Messages
3,454
Solutions
1
Reaction score
627
Location
Estonia
Since its already written out here, I just move it to better place. Incase somebody is bored or wants to help me.

I need new function.
function deathPenalty(player) end --(player is player userdata)

All the function features should be able to change in a single config table.

function features:
1. Looks trough all item slots on player.
feature config:
option1: slot item is removed.
option2: slot item is removed with % chance.
option3: random amount of stacked slot items is removed.
option4: random amount of stacked slot items is removed with % diminishing return. (example1* below)
option5: slot item will get item:getAttribute(TEXT, "soulbound") instead of remove.
option6: slot item has chance to be removed when item has TEXT "soulbound".
option7: slot item is removed when item has TEXT "soulbound".
option8: leave me nice ordered cap in function, where I can start scripting gem/stone upgrade removals.
2. Checks slot items:
feature config:
option1: Do nothing when itemID isInArray(item id array here)
option2: Do nothing when itemID with itemAID is in table = {k = {v}}
option3: attach [1.] config to itemID
option4: attach [1.] config to itemID with itemAID
option5: run custom function to itemID (I will make the custom functions) table = {itemID = functionName} (all custom functions use 2 parameters, itemID and player)​

3. Looks trough the equipped bag on player (NB! don't start looping bag into bag. In my server players can't put bag into bag, unless its special type of bag. Which I deal with myself)
feature config:
option1: item is removed.
option2: random amount of stacked item is removed.
option3: random amount of stacked item is removed with % diminishing return. (example1* below)
option4: item is placed on player body instead of removing from game.
option5: item has chance to be removed.
option6: item is removed when item has TEXT "soulbound".
option7: item has chance to be removed when item has TEXT "soulbound".
option8: leave me nice ordered cap in function, where I can start scripting gem/stone upgrade removals.​

Example 1 formula:
DR= 10
first removes DR% of stack (math.floor).
then with 100-DR % chance it will decide will it remove DR% again.
Now the chance of removing DR% will be 100-DR*2
unless it doesn't fail.
next chance is 100-DR*3
etc.
prefer this formula with while loop.

Uhm, I guess that is it for now.
 
setDropLoot(boolean)
Re-write that and make it a metamethod of player then register it to an onDeath or onPrepareDeath event.
You will most likely have to suppress the droploot function in the sources, unless there is a flag in config that sets it to false already?
 
setDropLoot(boolean)
Re-write that and make it a metamethod of player then register it to an onDeath or onPrepareDeath event.
You will most likely have to suppress the droploot function in the sources, unless there is a flag in config that sets it to false already?
I don't have to make this script, was posting here if someone else wants to make it for me and then I improve it.
 
I don't have to make this script, was posting here if someone else wants to make it for me and then I improve it.
You do have to make this script if no one will make it for you :p
Besides I do recall you stating somewhere that you were one of if not the best programmers on otland so you being such a 'superb' coder, constructing a method such as this is mere child's play for someone like you :p
 
Last edited:
You do have to make this script if no one will make it for you :p
Besides I do recall you stating somewhere that you were one of if not the best programmers on otland so you being such a 'superb' coder, constructing a method such as this is mere child's play for someone like you :p
don't ever remember saying I'm best, but I do feel pretty confident now.
Although this script would take like 3-6 hours to make, but since it's easy I though someone wants to polish their skills and it would be script for whole community.
Because if I do it on my own, I won't be putting it out there.
 
don't ever remember saying I'm best, but I do feel pretty confident now.
Although this script would take like 3-6 hours to make, but since it's easy I though someone wants to polish their skills and it would be script for whole community.
Because if I do it on my own, I won't be putting it out there.
That is why no one has offered to help you :(
Because you don't share...
 
That is why no one has offered to help you :(
Because you don't share...
Perhaps, but why should put unique Whi World scripts or scripts I have made for specific servers out there?
Is it not enough I have guided everyone who has asked, how to make these scripts?

Why we need exact copies of all I do in OTLand, isn't it more important to teach them how to do it?
I started out like this and I think its best I could ask for.

I usually don't request scripts, but there has been few people time to time, who seem to want to do something interesting and new.

Also this post1 is a "written" example of how my scripting though process works. Every time I make a script I start from config.
This could be the second "advanced" function used in Whi World, what also exists in OTLand, if anybody even comes close to what I asked on post1.
And I'm 50% sure I have to change it, but then I also will keep updated it in this thread.
 
Back
Top