How to make a sword kill feed with a stud log UI?

HELP!
I need a kill feed that uses the linked sword. It needs to show how far away (in studs) the person got killed.
Example:

if possible, could the entire text turn red if its more than 12 studs?
help me i am not a programmer and I have no idea what to do…

1 Like

soo hmm how do u kill a person from more then 12 studs with a melee weapon?

also I am pretty sure it against the rules to spoon feed code or a whole system

2 Likes

exploits is how. thats why i need it red

hmm…

1 Like

im not asking for entire scripts im just looking to see how to get the studs on there and/or to get it red

i looked at that but to me its kind of confusing

Get the Sword Wielder HumanoidRootPart Position or Sword Handle Position when damage is applied, as well as the part touched by the sword (aka enemy) position

humanoid.Health -= damage
local WielderPos = player.Character.HumanoidRootPart.Position
local targetPos = touchedPart.Position

To get the distance between those positions, use magnitude:

local distance = (WielderPos-targetPos).magnitude

If you want to round the distance, use math.round(distance).

distance = math.round(distance)

If you want to round it with a decimal, then instead of just using rounding do math.round with distance*10, then divide it by 10 afterwards:

distance = math.round(distance*10)/10

To check if distance is larger than 12, use an if statement:

if distance >= 12 then

end