Linked Sword kill distance In studs help

Hello everyone, I wanted to implement a linked sword stud distance kill feed, similar to other sword fighting games, such as Stay alive and Steal Time From Others.

I went on YouTube, and searched the dev forums, did not find any helpful resources, or guides that could help me get an understanding of how I could do such thing. I saw it had something to do with magnitude, but none explained in depth what it did, or where it would be implemented. I was wondering if any of you could give me an idea, or resource that can help me accomplish this, Thanks.

Here is an example of what I mean

https://gyazo.com/a39d24e495a6b7e320e248df2d20adb7

2 Likes

You can get the distance between the two players using magnitude:

local distance = (enemy.HumanoidRootPart.Position - attacker.HumanoidRootPart.Position).Magnitude

Do you know how I could implement this so it fires a new gui message to all clients when a player is killed?

Use remote events, then use FireAllClients
Remote Functions and Events (roblox.com)

I know how I could use remote events with this, Iā€™m just unsure where I would put it in the sword script to detect when a player is killed, and display distance