Hello, I have been trying for ages to try and get this single not-so-local part to function properly. I am trying to make it so when a player touches a part, it will load a local part. That works fine, but the part is not quite local, everybody can see it.
Please tell me what is wrong with this local script and why it isn't loading on the client side but on the server side.
local localpart = game.Lighting.Part game.Workspace.PartLoaderBrick.Touched:connect(function() localpart.Parent = game.Workspace.CurrentCamera end)
Every object should be in the right directory.
The local part is in Lighting, The local script is in Starter GUI, The part loader brick is in the Workspace, and filtering enabled is on for the game.
Thanks for any help you might offer.
remove the current camera in the parent part of the script also u need to connect the touched function and to do that u type
game.Workspace.PartLoaderBrick.Touched:connect(function(hit) if hit.parent:FindFirstChild("Humanoid") then--when u walk on the part if will change the parent of the part inside lighting to the workspace for ur eyes only localpart.Parent = game.Workspace end end)
You can clone parts on the client, you know. Clones of instances that are made on the client are going to be local.
So, here's the fix:
local localpart = game:GetService("Lighting"):WaitForChild("Part") workspace.PartLoaderBrick.Touched:Connect(function(hit) local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) if player then localpart:Clone().Parent = workspace -- The clone should be local end end)