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

How do i make an object visible only to yourself?

Asked by 7 years ago

I would simply like to know how to make a object (for example a selection box) only visible to the player and no one else. I know how to place through a tool a selection box in a player but i would like to know how to make it visible only to the player.

Thanks

0
Enable FE and create the object on the client(In a local script). AZDev 590 — 7y

1 answer

Log in to vote
3
Answered by
Pyrondon 2089 Game Jam Winner Moderation Voter Community Moderator
7 years ago

SelectionBoxes have a property called Adornee. This property allows you to set what the box is adorned to. By parenting the SelectionBox to the player's PlayerGui, and setting its adornee to whatever you're trying to adorn it to, you can make it so only that player sees it.

Here's a snippet for you (modified from the wiki):

local selection = Instance.new("SelectionBox")
selection.Color3 = Color3.new(0.6,0.6,0.6)
selection.Parent = player.PlayerGui
selection.Adornee = workspace.Part

And that's all it takes. However, local parts1 don't work like that; if you want to do this with more than just SelectionBoxes, I recommend you read up on it.

Hope this helped.


  1. I'm not a big fan of this wiki page; in my opinion, if you want local parts you should just use FilteringEnabled and create the part on the client, instead of relying on hacky & unsupported techniques. 

Ad

Answer this question