Dice Roll returning negative numbers.

No matter what i set the dice to it always returns a "-99"
Does anyone know how to fix this?
HP = DiceRoll("d10")
msg ("You now have " +HP+ "HP.")

wait never mind i found the problem.

you probably realized this already, it's:


3 dice with 12 sides:

DiceRoll ("3d12")

you're missing the input of 'NUMBER_OF_DICE', as seen in your code:

HP = DiceRoll("d10") // HP = DiceRoll("{MISSING_NUMBER_OF_DICE_INPUT}d10")

also note that the 'HP' is a 'Variable' VARIABLE, meaning that it's destroyed upon its parent scripting ending/finishing, so if you want to preserve your 'HP' and its stored Value, you should use an 'Attribute' VARIABLE instead, for example (so long as your 'player' Player Object exists/still-exists):

player.HP = DiceRoll ("1d6")


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