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

How do you make local parts if filtering is enabled?

Asked by 6 years ago

I'm trying to make it so a part is invisible for only one person but with filtering enabled it won't let me directly make it invisible from the client. When I used an RemoteEvent it still changed it for everyone.

Local Script:

Storage = game:GetService("ReplicatedStorage")
trans = Storage.trans
workspace.SpawnLocation.ClickDetector.MouseClick:connect(function()
    trans:FireServer()
end)

Server Side Script:

Storage = game:GetService("ReplicatedStorage")
trans = Storage.trans
function transp()
    workspace.SpawnLocation.Transparency = workspace.SpawnLocation.Transparency + 0.1
end
trans.OnServerEvent:Connect(transp)

2 answers

Log in to vote
1
Answered by
Rare_tendo 3000 Moderation Voter Community Moderator
6 years ago

To make it invisible for one person, just change its transparency on the client side only.

Storage = game:GetService('ReplicatedStorage')
workspace.SpawnLocation.ClickDetector.MouseClick:Connect(function()
        workspace.SpawnLocation.Transparency = workspace.SpawnLocation.Transpareny + 0.1
end)
Ad
Log in to vote
1
Answered by
INOOBE_YT 387 Moderation Voter
6 years ago

Local Script:

Part.Transparency = 1

Using a remote event makes it so that the server receives the message too and changes it for all clients. In this case, you want to change it for just the client, so you only use a local script with no remote event.

Answer this question