I’m trying to make a banish command. its a part banish, its supposed to get parts in a x radius from a player and delete those parts. any leads?
You should be using Magnitude
to get a Radius around the Instance.
As @DasKairo said, you can use a magnitude. Basically, get all the parts that can be deleted (for example, workspace:GetChildren()) and check the distance between the player and the part. If the distance is longer than the set value, it will destroy the part.
How would I do this exactly? This is something I’m trying for the first time and don’t know how to really compile this.
I’m not going to give you code just because you don’t know how to, You should Probably learn the Basics to what you want, if not, learn the very Basics of what you are trying to achieve.
Scripting Support is a place for you to get help with code, not to get code, it is also against the rules to do so.
Plus, you can easily find tutorials for your Issue.
Nobody is obligated to give you anything just because you don’t know how to.
This is the first time using that function, mind you point me to a good source?
Hmm, alright, I’ll test it when I get home. But for clarification, the tutorial also details finding parts in a radius right?
You Use Magnitude
as a length, or Radius
So you mean if it as in a circle right?
Basically, you would use a for
loop to get all the Parts in the workspace
, you would check if the Item is a Part
, and Compare the Difference of their Positions
,then you would check if the The Distance is less than a Certain amount, if there is a Part with that length, you would destroy it, the very beginning of the video will literally show you how it works.
Alright, noted, thank you, I’ll test it out
A magnitude is the size of a vector.
Its Basically the Length of a Vector in Roblox so ¯\_(ツ)_/¯
I guess it could be size as well
It’s the size of a vector in roblox aswell.
Yes. (Assuming you mean in Length)
Edit: Length can be interpreted as Size so idk what I’m saying
Yes. The size of a vector can be considered as the distance between two points