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)
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.
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteName")
local ProxminityPrompt = script.Parent.ProximityPrompt
local ProximityPromptService = game:GetService("ProximityPromptService")
local ServerScriptService = game:GetService("ServerScriptService")
local TheProxminityPrompt = script.Parent.ProximityPrompt
local ProximityPromptService = game:GetService("ProximityPromptService")
local ServerScriptService = game:GetService("ServerScriptService")
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
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.