Heal Command?

Hi. I'm trying to make it so that I can heal a player with a command. I already have an attribute set up for "potions", and I'll eventually set it up so that when it heals, the attribute decreases.

This is what both of them look like so far.

Heal Potion #object#

if (player.hyper_potion > 0) {
if (player.hitpoints < player.max) {
player.hitpoints = player.hitpoints + 60
}
}

Heal Hyper Potion #object#

if (player.potion > 0) {
if (player.hitpoints < player.max) {
player.hitpoints = player.max
}
}

I'm just really not sure how to set them up, and how to type them.


Looks like your typing is correct, maybe the names swapped...
Potion heals
hyper potion is full heal

I think, make a object "potion" and "hyper potion" and put the code in the "use" command.


How would I do the use command if I am using the web editor?


Wait, I'll just put it in the object verbs. Nevermind.


Sometimes... just saying it out loud solves the problem.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums