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

Solved Reward Chest System

silveralol

Advanced OT User
Joined
Mar 16, 2010
Messages
1,480
Solutions
9
Reaction score
212
SOLVED

anyone have a reward chest prototype working ?
I'm trying to create this but is hard to divide the damage in map
-.-
using it don't work
Code:
if damage.total >= ((monsterMaxHealth / 100) * 10) and damage.total < ((monsterMaxHealth / 100) * 25) then
I tryed use it: https://otland.net/threads/reward-chest-boss-reward-tfs-1-2.233397/
but don't work properly, so I'm trying make a new way to make it
question ...
how I can make the corpse a virtual depot? to each player open the corpse and get your own reward
I have a small script, he create the loot, put into the bag and send it to player inbox, but I don't know how divide the damage
 
Last edited:
You are still calling a Player method before validating Player userdata. Move the if statement below local attackerPlayer = Player(pid), and before local rewardchest..
 
Well its not question about this thread but can someone explain why this code:
Code:
if not targetMonster:isMonster() then
        return true
    end

Is returning true ? If target is not monster then return true? Why not false?
 
Well its not question about this thread but can someone explain why this code:
Code:
if not targetMonster:isMonster() then
        return true
    end

Is returning true ? If target is not monster then return true? Why not false?
the return true will finish the script... if return true will no load more lines below it
You are still calling a Player method before validating Player userdata. Move the if statement below local attackerPlayer = Player(pid), and before local rewardchest..
you solve it, just move the line
Code:
local rewardchest = attackerPlayer:getRewardChest()
to below of
Code:
 if attackerPlayer then
so much thanks!
 
the return true will finish the script... if return true will no load more lines below it

you solve it, just move the line
Code:
local rewardchest = attackerPlayer:getRewardChest()
to below of
Code:
if attackerPlayer then
so much thanks!
Next time post code from line 1 to line wherever the error occurs.
Because I saw no codes where you wrote constructed userdata before the if statement.


Well its not question about this thread but can someone explain why this code:
Code:
if not targetMonster:isMonster() then
        return true
    end

Is returning true ? If target is not monster then return true? Why not false?
Doesn't matter. in this case return is used to stop the function.
anything can be returned here even nothing, because most likely return is not used.
 
Next time post code from line 1 to line wherever the error occurs.
Because I saw no codes where you wrote constructed userdata before the if statement.



Doesn't matter. in this case return is used to stop the function.
anything can be returned here even nothing, because most likely return is not used.
I'm sorry for it, I'll understand if you don't understand why I not post in the start :/
next time I'll be more carefull with it ;)
so much thanks for try help me
 
Glad you got it solved. As @whitevo said, had you posted the entire thing rather than trying to "censor" parts of it we could have came to this conclusion a long time ago. Nobody here was trying to be a dick to you at first. I quite literally loaded up a test server and copied your script into it each time just to make absolute sure I was not overlooking something silly. Every time I tested it was error free. I am sure you can see the frustration this causes when we are trying to help you and move on to the next person.
 
Glad you got it solved. As @whitevo said, had you posted the entire thing rather than trying to "censor" parts of it we could have came to this conclusion a long time ago. Nobody here was trying to be a dick to you at first. I quite literally loaded up a test server and copied your script into it each time just to make absolute sure I was not overlooking something silly. Every time I tested it was error free. I am sure you can see the frustration this causes when we are trying to help you and move on to the next person.
I understand your frustration, next time I'll not censure nothing, and for all of you, I'm so sorry about it!
 
Back
Top