So when I make a part inside a local script it doesn't show the other player the part. How do I fix this?
How do I fix this local part problem?
2 answers
You can use Remotes! :D
Remotes are RemoteEvents and RemoteFunctions. These provide client to server communication and are normally used for FilteringEnabled.
So, you need to use the FireServer function on a RemoteEvent in ReplicatedStorage. This will send a request to the RemoteEvent and if there are any OnServerEvent events listening, then they will fire upon recieving the request.
--Your RemoteEvent
local re = game.ReplicatedStorage.CreatePart
--Use the FireServer function on it
re:FireServer()
Note: This should be a localscript^
Now, you can have a script inside the remote event that creates the part. You need to use the OnServerEvent event to 'listen' for the FireServer request.
script.Parent.OnServerEvent:connect(function()
--Create the part
local p = Instance.new("Part",workspace)
p.Size = Vector3.new(5,5,5);
p.Anchored = true;
p.CFrame = CFrame.new(0,10,0)
end)
Note: This should be a server script^
What would be wrong with this?
script.Parent.OnServerEvent:connect(function(Player,player,char,scan)
for _,scan in pairs (scan) do
if scan.ClassName == "Hat" or scan.Name == "Pants" or scan.Name == "Shirt" then
local clone = scan:Clone()
clone.Parent = char
if scan.ClassName == "Hat" then
local weld = Instance.new("Weld",char.Head)
weld.Part0 = char.Head
weld.Part1 = clone.Handle
weld.C0 = CFrame.new(0,0.5,0)
weld.C1 = clone.AttachmentPoint
end
end
if scan:FindFirstChild("face") then
local clone = scan.face:Clone()
clone.Parent = char.Head
end
end
end)
1 comment
scan is a table of objects.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Can you explain this a little better? I do not understand what you are asking. I am almost certain that the others do not either.
I am certain you are using filtering enabled, if that is the case then anything made in a local script will not work for anyone else.