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

How do I put a SelectionBox on player click?

Asked by 9 years ago

What I mean by that, is what I want is when a player clicks another player (in Workspace), the player they clicked will have a SelectionBox that only they can see (the player that clicked can only see it) like on Trade Hangout.

How do I do this?

3 answers

Log in to vote
2
Answered by 7 years ago

When the player is clicked, insert a SelectionBox into the player's character and set the adornee of that SelectionBox to the Character, you may want to do this locally or it will show for every player.

Ad
Log in to vote
0
Answered by 9 years ago

I personally have never tried doing something such as this but I am almost certain I know how it would work.

You would need to place a ClickDetector object to be placed inside of each person's character's parts as they spawn. This would allow for other users to click on the parts and for the script to recognize that they clicked the person's body. You will need to use Local Parts to create the SelectionBox around the character. This can be done in a multitude of ways but I would suggest cloning the player's torso, making it invisible, resizing it to be as large as the character and then placing the selection box inside of it and making sure rotate and position the selection box parent with the player's torso. This can be achieved with a while loop.

I am sorry that I could not provide any code for this, but I have never done such a thing personally. I hope this helps!

0
You didn't need to supply a Script, this was a Request and Request is Against the Rules of ScriptingHelpers. woodengop 1134 — 9y
2
This is not a request. A request would be if he asked somebody to create the entire script for him. He only asked for a starting point and a path that he should follow which I supplied and would have furthered with a bit of code. Thank you for your feedback though. FearMeIAmLag 1161 — 9y
2
This is not a request at all. He asked 'how' rather than 'MAKE ME!!!!!!' DigitalVeer 1473 — 9y
Log in to vote
0
Answered by
Discern 1007 Moderation Voter
9 years ago

You could also set FilteringEnabled on in Workspace (if it isn't already).

That way you don't need Local Parts (as FearMeIAmLag said). You just need LocalScripts inside the player and just create a SelectionBox like you normally would, and it would only show up to the player with the LocalScript.

That being said, you would have to edit your scripts a lot if you use FilteringEnabled.

Answer this question