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

How to properly make a part local?

Asked by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

I'm a bit new to making it so only a player can see that specified part. The current script I have is a local script in Workspace. It's supposed to clone a brick and put it into the player's CurrentCamera. Of course this script is only so I know how to properly use this. I have a plan that involves this, so any tips? No output errors.

a = game.Lighting.Part

game.Players.PlayerAdded:connect(function(p)
    repeat wait() until p.Character
    a:clone().Parent = game.Workspace.CurrentCamera
end)

2 answers

Log in to vote
1
Answered by
Lacryma 548 Moderation Voter
10 years ago

You will need to use this in a local script inside the player.

a = game.Lighting.Part
plr = game.Players.LocalPlayer
cam = Workspace.CurrentCamera

a:Clone().Parent = cam

As an alternative

0
So, I would need to parent this script to the player? Shawnyg 4330 — 10y
0
Mhm, or playegui. Since local parts and camera needs to be client side. Lacryma 548 — 10y
Ad
Log in to vote
1
Answered by
Vividex 162
10 years ago

Or just put this inside of a local script in StarterGui or StarterPack:

Instance.new('Part', Workspace.CurrentCamera)

Which makes a part only there character can see.

Answer this question