Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Insert a part into workspace that only one person can see? (Client sided)

2 answers

✓ Accepted answer

There are two ways to do this, I will be using the one that does not require FilteringEnabled (FE.)

Useful Resources:

http://wiki.roblox.com/index.php?title=API:Class/Workspace/CurrentCamera http://wiki.roblox.com/index.php?title=API:Class/LocalScript

Alright, what you'd need to do is have a LocalScript somewhere within the player or character (this includes PlayerGui/StarterGui, Backpack, Humanoid, etc.)

In that LocalScript, you will be inserting a part into the local player's CurrentCamera, like so:

Local Part Insertion LocalScript in StarterGui

local localCamera = game.Workspace.CurrentCamera
Insert.new("Part", localCamera)

Anything in the local player's CurrentCamera can only be seen by that player.

The downside with using this technique, though, is that scripts cannot run inside CurrentCamera, so I do not suggest using this technique if you have scripts in those parts or anything like that. A solution to this is to have the scripts outside of CurrentCamera, yet the parts inside, and edit those parts that way.

I also suggest that you learn to use FilteringEnabled: http://wiki.roblox.com/index.php?title=Client-Server_Model_and_FilteringEnabled

If you found my solution helpful, consider leaving an upvote and accepting my answer. Also, check out my website: http://robloxguides.com/!

To do this you will need a local script on backpack. What you will do is make the local script target the local player's camera.

So, you only need to do part.Parent = workspace.CurrentCamera

CurrentCamera returns the local player's current camera. On scripts itll return the template camera. Hope this helps!

2 comments

0

Don't discourage people to not use FE. This answer is fine, but downvoting a better solution is not.

0

There is no need to downvote each other. My opinion, if you're not advanced or you're too far along in the development process of your game use CurrentCamera. If you know how to, use FilteringEnabled. However I encourage both of you to provide such option. You two do not need to downvote each other.

This discussion is preserved as it was. New answers, comments, and votes are closed.