Jump to content

LSL Operators Division Problem?


Killi Cloud
 Share

You are about to reply to a thread that has been inactive for 1817 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am trying to figure out a hit system based on enemy strength with user programmable strength and my code looks a little something like this...

integer my_health = 100; // TAKES 10 HITS TO KILL ME IF NUMBER IS 100

integer health = 100;

take_hit(integer strength){
integer hit_math = (strength /my_health) * 100;
health = health - hit_math;
}

default{

touch_end(integer num){
take_hit(10);
}

}

but for some reason "hit_math" keeps returning 0.

Now maybe I have not had enough coffee yet but the math should work ( (10/100) * 100 = 10 ), what am I doing wrong?

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1817 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...