Is there a way to visualize studs?

(Not sure if this is the topic this should be in, please let me know if it isn’t.)
Hello developers, I’m making this post to ask if it’s possible to visualize studs when trying to measure stuff.
This is part of some code I’m implementing to prevent exploiters from attacking 500 studs away or something, It’s to prevent issues where exploiters make the in-game weapons insanely long or something and kill everything across the map.

Any help with this is appreciated massively,
Thanks, MBroNetwork

If your trying to detect if they are killing from over 500 studs, you could use magnitude to check the distance between the 2 players

The 500 studs was an example, But that’s what I mean, I’m having issues getting the distance accurately in-order to figure out the maximum distance an attack can occur.

iirc all you have to do is

if (player1.Character.HumanoidRootPart.Position - player2.Character.HumanoidRootPart.Position).Magnitude >= 100 then
--do whatever
end

change the 100 for the maximum distance they can kill from

I’m guessing that magnitude measures in Studs?
(I haven’t used distance checking much)

It should, you can read more about it here:

Thanks for all of the help, I appreciate it so much.
:slight_smile:

1 Like

I would like to thank @123jar456on2 for the help with Magnitude.
I found my solution to measuring studs accurately, the snap to grid feature in Studio lets you move by studs so I can use this to gauge the distance between 2 parts accurately with scripts in-order to get the exact distance required.

1 Like