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

How do I make Client side scripts such that the script applies to the client, not the whole server?

Asked by 6 years ago

E.g

If I want a part to vanish for the local client only when he touches it, i want that the part should disappear for only that specific person who touched it and not anyone else.

Please help and give any reference you have for links or text.

2 answers

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

If you have FilteringEnabled, you can just detect the part being touched through a LocalScript. If you made a LocalScript inside something like StarterGui, you could do something like this:

local part = workspace["PartName"]
part.Touched:Connect(function(hit)
    if hit.Parent == game.Players.LocalPlayer.Character then
        part.Transparency = 1
    end
end)
0
I never knew it was this easy to modify parts in the workspace with FE. TheRings0fSaturn 28 — 6y
0
thx so much AlexStorms 21 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

But @mattscy Why does it only work when I put it into the starter GUI, why nowhere else, can you show me how to script it if I put it inside the part, or it doesnt work that way?

Answer this question