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

How would i make a part visible when a player touches it?

This is my Script:

local Check = game.Workspace.C1 function onTouched(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h~=nil then Check.Transparency = 0 end end script.Parent.Touched:Connect(onTouched)

I tried this in a local script but it doesn't work, so I used it on a normal script and it works, but the thing is I need to be able to make it so that only the player that touched the block can only see it.

if anyone needs more info, please let me know.

5 comments

0

@bt6k in this case, I am trying to use a local script to make the part visible, but in another case when you want the whole server to see the part, you would have to use a script for the format you gave me so it didn't work, but thanks for trying to help, I appreciate it.

0

If Its A Local Script then You Could Use Remote Events/Functions,

0

@crueluu I am using Remote Events and Functions

0

then you might be using them incorrectly i sent you a link on remote events and how to use them, and check that the script is in serverscriptservice or serverstorage, and the remote function/event is in replicated storage otherwise it wont work.

0

@crueluu but i dont want to fire a server event because i only want it to be visible for the player that touched the block

2 answers

Hi there,

Try just using If h then, how I wrote it down here,

local Check = game.Workspace.C1 

function onTouched(hit) 
	local h = hit.Parent:FindFirstChild("Humanoid") 
	if h then 
		Check.Transparency = 0
	end 
end 

script.Parent.Touched:Connect(onTouched)

Sorry if this doesn't help...

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