Where should I start? I don't know much about magnitude but this is my code so far.
1 | for _, i in pairs (game.Players:GetPlayers()) |
2 | if i = = workspace.Part.Magnitude then |
3 | print ( "Player is near an object within its radius of 2.53" ) --Something like this. |
4 | end |
5 | end |
1 | maggie = (xyz_A-xyz_B).magnitude |
-- xyz1 and xyz2 could be "workspace.PartThingy.Position" (as an example)
1 | if maggie < = 2.53 then -- just make sure you can get 2.53 and under using "<=" |
2 | print (i.. " is near an object within its radius of 2.53!" ) |
3 | end |
1 | maggie = (xyz_A-xyz_B).magnitude |
2 |
3 | for _, i in pairs (game.Players:GetPlayers()) |
4 | if maggie < = 2.53 then |
5 | print (i.. " is near an object within its radius of 2.53!" ) |
6 | end |
7 | end |
and then that same Lua nerd will let you do the rest.
U should try use PlayerDistanceFromCharacter and set the vector point of the object something like this maybe
01 | for _, i in pairs (game.Players:GetChildren()) |
02 | while true do |
03 | if i:PlayerDistanceFromCharacter(Vector 3. new(number,number,number)) < 2.53 then |
04 | print ( "Player is near an object within its radius of 2.53" ) |
05 |
06 |
07 |
08 | end |
09 | end |
10 | end |
not sure if this will work im just guessing might work i guess