Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

2 comments

0

I never knew it was this easy to modify parts in the workspace with FE.

0

thx so much

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?

This discussion is preserved as it was. New answers, comments, and votes are closed.