Well everything works fine except Im getting 1 error
O.HP:undefined var
obj
Fireball
icon = 'Fireball.dmi'
density = 1//make it dense
Bump(atom/O)//bumps an obstacle
if(ismob(O))//if its a mob
oview(O)<<"[O] is hit for 15 Damage!"
O.HP -= 15
ID:175658
![]() Mar 23 2003, 8:17 am
|
|
![]() Mar 23 2003, 8:23 am
|
|
Have you defined HP somewhere else in your code for that mob?
|
Maybe you should try mob/M instead of atom/O and take out the ismob. If you dont want to do that, show me where you have defined HP for the mobs.
|
Jotdaniel wrote:
Maybe you should try mob/M instead of atom/O and take out the ismob. If you dont want to do that, show me where you have defined HP for the mobs. If you do that and take out the ismob(), any obj entering will cause a runtime error. Just because you use mob/M does not mean its only triggered when a mob is sent as a reference, it simply means that it assumes what is entering is a mob. |
Erm, right. I should know that, I use this a lot. Ok, I'm just not sure hes defined HP correctly still.
|
This is where i define the vars
mob Stat() statpanel("Stats") stat("Level: [src.Level]") stat("Health: [src.HP]/[src.MAXHP]") stat("MP: [src.MP]/[src.MAXMP]") stat("Gold: [src.Gold]") stat("Experience: [src.Experience]") stat("Max Experience: [src.MaxExperience]") stat("Strength: [src.Strength]") stat("Defense: [src.Defense]") if(src == usr) statpanel("Inventory",src.contents) var HP= 20 MAXHP= 20 Experience = 0 MaxExperience = 100 MP =0 MAXMP =0 Strength = 4 Defense =5 Level = 1 Gold = 0 expgive = 0 BankGold = 0 |