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

How to make a invisible block?

like leaving a visible block only for a person? , Example: has a block on top of my head but I can only see, other players not

2 comments

0

You could place the Part in the Player's 'CurrentCamera'. http://wiki.roblox.com/index.php?title=CurrentCamera

0

You can also create local parts by using FilteringEnabled and creating a part in a localscript.

2 answers

✓ Accepted answer
--[[
	Test Place:
		Workspace
			Script
				Local Script
		-	-	-
		-	-
		-
		
	In Server 2 Players:
		Server=
			Workspace
				Script
			Players
				Player1
					Backpack
					PlayerGui
						Local Script
					StarterGear
				Player2
					Backpack
					PlayerGui
					StarterGear
			NetworkServer
				...
		
		Player1 sees=
			Workspace
				Script
				Part
			Players
				Player1
					Backpack
					PlayerGui
						Local Script
					StarterGear
				Player2
					Backpack
					PlayerGui
					StarterGear
					
		Player2 sees=
			Workspace
				Script
			Players
				Player1
					Backpack
					PlayerGui
						Local Script
					StarterGear
				Player2
					Backpack
					PlayerGui
					StarterGear
		
--]]

-- File:Script in workspace
game.Players.PlayerAdded:connect(function(Player)
	if Player.Name == 'Player1' or 'Player' then --Check for specific Player
		Player.CharacterAdded:connect(function() --Make sure there is a character
			script.LocalScript.Parent = Player.PlayerGui --Execute Script
		end)
	end
end)

--File:Local Script in Script /\
local CurrentCamera = game.Workspace.CurrentCamera -- Get Camera
local Part = Instance.new('Part') --Do not parent yet

--Make the part stuff...
Part.Name = 'Invisible Part'
Part.Position = game.Workspace:WaitForChild(script.Parent.Parent.Name).Head.Position + Vector3.new(0,2,0)
Part.Size = Vector3.new(2,2,2)

wait(2) -- A little timeout eh?
Part.Parent = CurrentCamera --Parent to Current Camera to become an official Local Part

2 comments

0

This needs an explanation in english. The comments in the code are hard to read and slightly confusing.

0

Wow thx for the help its working

What you want are Local Parts

I won't go into much detail, because the wiki explains it well enough and provides examples

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