How do I make a part which can be only seen a specific player?

Hello devs currently i am making a piggy inspired game and i’m using @Alvin_Blox’s piggy kit.
So the piggy/ninja in the game’s has less walk speed than the player/survivors.
I want to make a shortcut the only the piggy/ninja can see and use.

I made two to three blocks and made them higher and higher.

script.Parent.Touched:Connect(function(hit) -- there is a part below the invisible block which makes it visible when touched.
	if hit.Parent:FindFirstChild("Ninja") then -- the ninja has a string value called ninja.
		game.Workspace.Part.Transparency = 1 -- after checking the hit.Parent was the piggy/ninja it will make it visible.
		game.Workspace.Part.CanCollide = false -- and also collidable
	end
end)

The script is partially working but this causes the players also use that shortcut too.
Can anyone help me with this?

Try Putting it in a local script and disable the code if the player isn’t ninja

Anything thing that was created locally will only be visible for the client, so try creating the shortcut on the target client.

Currently your making the part invisible and not able to be touched, do you mean to do this? Your checking for them to be a ninja so I’m guessing thats not meant to be. 0 Transparency is visible and cancollide true will make them be able to walk on it.

That’s not the problem.
I wanted to make the part only visible to the ninja.

Yes that actually worked :smiley:
Thank you soo much.

1 Like