Hello, I just want to know if it's possible and what (function/snippet/concept/topic of lua) that I would use if I wanted to create something like this, basically I want you to point me towards a path that I can go to, to create this.
Is it possible to detect when a player is near a brick or when a brick is near another brick? What would I use to achieve this?
Please point me towards the right direction. Thank you!
Yes you could use magnitude here an example.
player = game.Players.LocalPlayer --define player part1 = game.Workspace.Part1 --the part you want to use to detect the player while true do -- use a while loop to constantly check if the player is close wait() if(player.Character.Torso.Position - part1.Position).magnitude <=5 then -- this line takes your characters position and subtracts it from the parts position ad check to see if it is less than or equal to print("You are near me") -- prints when you are close enough to the part end end --to detect two bricks same concept instead of adding player just add another part to the script so it would look like this part1 = game.Workspace.Part1 part2 = game.Workspace.Part2 while true do wait() if(part1.Position - part2.Position).magnitude <=5 then print("You are near me") end end
I hope this helps.