#1
|
||||
|
||||
New Item Function Issues
Here is the function:
PHP Code:
A) If pet's health is already 100, it does nothing (and does not use the item). B) If the pet's health is not 100, but the item value would put health OVER 100 then it instead only adds the amount needed to make 100. C) If the pet's health is not 100, and the item value would not go over 100, then it just normally adds the item value to increase the health. What it's doing: My pet's health is at 100. I test it. It tells me that it worked, added 2, and my pet's health is now 100. Then it actually turns my pet's health to 0. Now that my pet's health is at 0, I try again, it tells me that it added 2 and the health is now 2. Pet health still at 0. Please help? ;_;
__________________
My Mods Site (1.3.4, 2020 Mods) Last edited by Abronsyth; 11-19-2016 at 12:48 PM. |
#2
|
||||
|
||||
Just tested this and I can't seem to replicate it. Do you have anything that lowers the health of your pet elsewhere?
I did notice that the item was used even if the pet's health was at 100 though, so that can be prevented by changing: PHP Code:
PHP Code:
__________________
|
#3
|
||||
|
||||
For some reason it seems to just keep resetting it to 0.
Here is the function currently: PHP Code:
__________________
My Mods Site (1.3.4, 2020 Mods) Last edited by Abronsyth; 11-20-2016 at 08:41 AM. |
#4
|
||||
|
||||
I think I fixed the problem. Try this:
PHP Code:
PHP Code:
Looking back on this code, I can't really see what's different about it, but it apparently works on my end now? Let me know if it doesn't.
__________________
Last edited by Dinocanid; 11-20-2016 at 11:44 AM. |
#5
|
||||
|
||||
OK, seems to be working now. I need to test a few more things still, and then I'll know for sure.
EDIT: Yes, all three instances are working flawlessly! Thank you! I really appreciate the help <3
__________________
My Mods Site (1.3.4, 2020 Mods) Last edited by Abronsyth; 11-20-2016 at 01:22 PM. |
#6
|
||||
|
||||
No problem!
__________________
|
|
|
What's New? |
What's Hot? |
What's Popular? |