Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a stud log? Ex: (Player1 [5 studs] killed Player2)

Asked by 3 years ago
Edited 3 years ago

I am working on a Sword Fighting Game and I need help adding a stud log.

i currently have no progress on this, i dont know if anyone can help me, but anything is appreciated!

what i mean by stud log, is that a player kills another player and it tells you the distance (studs) they were killed from, on a textLabel that is in a Frame.

i am a noob at scripting so give me as much information as possible. Thanks!

0
This is not a request site. Please look at the community guidelines before posting a question: https://scriptinghelpers.org/help/community-guidelines appxritixn 2235 — 3y
0
i- didnt make a request... Julien999111 0 — 3y
0
I see you edited your post. Previously, you mentioned us giving you a GUI and telling you where to put it, which is literally a request. I understand that you realized you made a mistake and tried to fix it, which is good, although that doesn't mean you never made the mistake. appxritixn 2235 — 3y

1 answer

Log in to vote
0
Answered by
CDXKIE 130
3 years ago

@phxntxsmic is right, you should attempt to do something before posting here. However, I kinda want to help you, so i am going to show you how to get the distance between one player and another. (you will have to code everything else, however.)

There is a thing called magnitude which is basically distance as far as I know. You could get the magnitude between two character's HumanoidRootPart, which I like to get with "Character.PrimaryPart":


local function GetDistance(plrOne, plrTwo) local characterOne = workspace:FindFirstChild(plrOne.Name) local characterTwo = workspace:FindFirstChild(plrTwo.Name) if not characterOne or not characterTwo then return end -- stops the function if there is no character for the players. I don't even know why I do this, I just like to. local distance = (characterOne.PrimaryPart.Position - characterTwo.PrimaryPart.Position).Magnitude return distance end -- if you want to get the distance, you get it anytime with this function. local playerDistance = GetDistance(Killer, Victim)

Keep in mind I haven't tested this, this is just a quick lesson.

0
imagine if my username on roblox was "Part" lmao greatneil80 2647 — 3y
Ad

Answer this question