Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Dexiber 272 Moderation Voter
4 years ago

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.

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. Dexiber 272 — 4y
0
If Its A Local Script then You Could Use Remote Events/Functions, crueluu 169 — 4y
0
@crueluu I am using Remote Events and Functions Dexiber 272 — 4y
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. crueluu 169 — 4y
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 Dexiber 272 — 4y

2 answers

Log in to vote
0
Answered by
bt6k 23
4 years ago
Edited 4 years ago

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...

Ad
Log in to vote
0
Answered by
crueluu 169
4 years ago

Here's A Link Explaining What Remote Events/Functions Are! https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events

Answer this question