How to show damage

Hi! I made weapons in my game, and now I want to show the amount of damage you dealt whenever you damage an enemy. How should I do this? Should I use text label in screen gui, or text label in bill board gui? Also how do I position the text label at the enemy?

You could use a BillboardGui which gets parented to the hit player’s head, and then use DebrisService to make the gui delete itself automatically after a moment has passed. Make sure it has a TextLabel, and the text gets changed to whatever variable controls the damage in your weapon.

You should use a billboard gui to display how much damage was dealt. You can do this by either,

  1. Adding a .HealthChanged event to every humanoid and whenever its fired, clone a billboard gui to the humanoid and display the amount of health changed only if it decreased (probably the easiest and you also won’t have to worry about readding it for every new weapon you make)
  2. In your script when you damage a humanoid, clone a billboard gui into the character you damaged and display the amount of damage.

adding to what others said, the way you make it so the health bar sizes based on the health is by first making the size only be in scale, espicaly on the X axis, then making that health bar’s X scale be the humanoid’s health devided by 100 (0.4 for 40 health, 0.6 for 60 health) which will make it go to correct sizes

Ok guys so I just saw this post

I really like it but I can’t understand how it works tho, there’s no uncopylocked game or something. Can someone explain how do I add this to my game?

Edit: I followed the steps again and it worked :slight_smile:

The post you linked has an entire tutorial on how to implement it. You should just try to follow it first and it should be really easy.

oh ok, let me try to follow it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.