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

How to find LocalPlayer from a part that touches a part?

Asked by 2 years ago

I'll try to explain best I can.

I'm using .Touched to know when a part touches a part, and that works fine. But I want it to only fire for the LocalPlayer. It currently fires for everyone in the server.

Current local script:

local Part = game.Workspace.finish
Part.Touched:Connect(function(Hit)
    if Hit.Name == "PushBlock" then
        game.Workspace.TEMPLEDOORS3.Interact.ProximityPrompt.Enabled = true
        game.Workspace.PushBlock.ProximityPrompt:Destroy()

        end

Thanks.

1 answer

Log in to vote
0
Answered by 2 years ago

Try using RemoteEvents.

RemoteEvents are one-way communication. Using RemoteEvents you can send Information. I show you the different ways of sending Information, Im going to tell you where :FireClient and :FireServer are

:FireClient()

:FireClient() appears ONLY on Server Scripts (Or normal scripts)

:FireServer()

Like earlier just only for Local scripts

Client

Ad

Answer this question