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

How to make part visible to only specific player?

I put this in a local script, and used this script but doesn't work properly, any suggestions?

function onTouched(Hit)
	script.Parent.Parent.Door.Transparency= 0
	script.Parent.Parent.Door.CanCollide= true
end
script.Parent.Touched:connect(onTouched)

2 answers

Ok, this is kind of simple. You have to make the part transparent and can collide is off. Then in a LocalScript, not a server script. Then if you want a specific player to see something, then just do whatever you need in the local script.

Edit: I see the problem. You didn't check what the part touched. It could have touched another part and set it off. Make sure you know a player touched it.

script.Parent.Touched:Connect(function(hit)
	local char = hit.Parent
	local humanoid = char:FindFirstChild("Humanoid")
	if humanoid~=nil then
		--whatever code you need to do
	end
end)

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