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

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

Asked by 8 years ago

How would I insert a part into workspace that only one person could see?

0
You don't really need FE lol marcoantoniosantos3 200 — 8y
0
Without FE you are nothing. User#11440 120 — 8y
0
FilteringEnabled is usually better, but if you don't want to rewrite your scripts, it's easier to use CurrentCamera. RiftTalon 98 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

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/!

Ad
Log in to vote
0
Answered by 8 years ago

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!

0
Don't discourage people to not use FE. This answer is fine, but downvoting a better solution is not. User#11440 120 — 8y
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. M39a9am3R 3210 — 8y

Answer this question