Proximity prompt not working, 2 different scripts

I got two scripts, since regular script only works with proximity I got it so that it can fire a remote event to the player and then runs a local script. There are no errors.
The regular script:

local ProximityPromptService = game:GetService("ProximityPromptService")
local ServerScriptService = game:GetService("ServerScriptService")
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

TheProxminityPrompt.Triggered:Connect(function(player)
	Remote:FireClient(player)
end)

The local script:

local ProxminityPrompt = script.Parent.ProximityPrompt
local ProximityPromptService = game:GetService("ProximityPromptService")
local ServerScriptService = game:GetService("ServerScriptService")

Remote.OnclientEvent:Connect(function()
print("Success")
end)
2 Likes

It could be because you spelled OnClientEvent wrong. Try spelling it like I showed you, and tell me if it worked, as most roblox events are case sensitive.

2 Likes

Its still not working, no errors either.

1 Like

Can you show all of your variables? Some of them aren’t shown in the code blocks.

local script variables:

local Remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteName")
local ProxminityPrompt = script.Parent.ProximityPrompt
local ProximityPromptService = game:GetService("ProximityPromptService")
local ServerScriptService = game:GetService("ServerScriptService")

Script variables:

local TheProxminityPrompt = script.Parent.ProximityPrompt
local ProximityPromptService = game:GetService("ProximityPromptService")
local ServerScriptService = game:GetService("ServerScriptService")
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")

The remote event does fire but the local script does not receive it

Oh, I think I know the issue now. LocalScripts don’t work inside of parts. They only work in some places, like StarterGui, etc. Try putting it inside StarterGui, re-locate the proximity prompt, and tell me if it works.

I dont relocate the proxminity prompt right, just the local script to starter gui

Oh yeah, sorry, to clarify, move the LocalScript to StarterGui, and change the proximity prompt variable to where your proximity prompt is.

yea idk its still not recieving the event, are there any other ways to notify a local script when to start?

Wait I might have found the reason

Nevermind it doesnt it still doesnt work

Try the .Triggered event in the LocalScript.

I did a similar setup and it works for me, probably something on your end

1 Like

That works for me too, you might want to add prints in the server script to see if you’re actually activating it.

I found out why, like script positioning and stuff thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.