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

I'm trying to make an OnTouch invisible and walk through local part. Can someone help me?

How would I make a part so when a player touches it, it makes a certain part invisible and walk through only for that player? I'm making an obby, but at the end of it is a portal, and when someone touches the portal, a cutscene plays looking at a part that was visible but is now invisible and walk through only for the person that touched the portal. How would I do this? I have the cutscene done, I just can't figure out how to make the local parts. Could someone please help me?

This is what I have for my local parts code

local cam = workspace:FindFirstChild("LocalStorage")
if not cam then
	cam = Instance.new("Camera", workspace) --Creates a new camera in workspace.
	cam.Name = "LocalStorage" --Name the camera to something suitable.
end
 
local part = game:GetService("Workspace").BlockedWall1
local part2 = game:GetService("Workspace").BlockedWall2
local part3 = game:GetService("Workspace").BlockedWall3
part.Parent = cam --Place part in the camera.
part2.Parent = cam --Place part in the camera.
part3.Parent = cam --Place part in the camera.

P.S. it's in starter GUI in a localscript

1 comment

0

please include some code or we cant help you

2 answers

Just make a local script in the workspace and put your script in there. Local scripts are only replicated for the client and not the server.

Please be more clear on your question.

You can use a client OnTouch event on a client sided script, for that specific player, or if you have a server script for it, then you can just fire a remote to the specific client you want the part to be invisible.

Here's how to fire a client from the server


--Server

RemoteEvent.OnServerEvent:Connect(function(Player) 
    RemoteEvent:FireClient(Player)
end)




--Client

Part.OnTouched:Connect(function() 

RemoteEvent:Server() --Fire server to in return fire the client.--

end)

RemoteEvent.OnClientEvent:Connect(function(Player) 
--Your invisible part code here--
end)

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