Jump to content

LSL Operators Division Problem?


You are about to reply to a thread that has been inactive for 497 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 post
Share on other sites
You are about to reply to a thread that has been inactive for 497 days.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...