Proximity Prompts not working for some Players

Hey Developers!

So on a game I develop for, some of the Players are reporting problems that Proximity Prompts are not working for them. They work fine for me and the rest of my development team and the majority of our player base. But some people are reporting that they are not working, I can’t find any way to reproduce it and there are no client or server errors.

Apparently you are able to use it but it doesn’t do the action it’s meant to do, not sure if this is because the players are lagging or have a bad connection or if the code is wrong. But as I said it works for 95% of our players.

Any help would be appreciated as I have no clue! :heart:

1 Like

Please provide your script, we can’t help without seeing the script infront of our eyes.

1 Like

It’s just not the same one that keeps causing the same, but sure I’ll provide a script for ones that are providing the most issues.

local ToolName = {"White Chocolate Cookie"} 
local Storage = game.ServerStorage 
local Part = script.Parent.Parent
local ProximityPrompt = script.Parent

ProximityPrompt.Triggered:connect(function(Player)
	if Player and Player.Character then
		local Backpack = Player:WaitForChild("Backpack")
		for i = 1, #ToolName do
			local Tool = Storage:FindFirstChild(ToolName[i])
			if Tool then
				Tool:clone().Parent = Backpack
			end
		end
	end
end)
2 Likes

and Player.Character is useless here.
They can’t trigger the proximity if their character isn’t in-game.

Plus, I now tested it out with 2-3 players, and everything worked fine.

local Tools = {"White Chocolate Cookie"} 
local Storage = game.ServerStorage 
local Part = script.Parent.Parent
local ProximityPrompt = Part.ProximityPrompt

ProximityPrompt.Triggered:connect(function(Player)
	if Player then
		local Backpack = Player:WaitForChild("Backpack")
		for i = 1, #Tools do
			local Tool = Storage:FindFirstChild(Tools[i])
			if Tool then
				Tool:clone().Parent = Backpack
			end
		end
	end
end)
1 Like
local Storage = game.ReplicatedStorage 
local Tools = Storage.Tools
local Part = script.Parent.Parent
local ProximityPrompt = Part.ProximityPrompt

ProximityPrompt.Triggered:connect(function(Player)
	if Player then
		local Backpack = Player:WaitForChild("Backpack")
		for _,tool in pairs(Tools:GetChildren()) do
			local Tool = tool:clone()
			Tool.Parent = Backpack
		end
	end
end)

This could also work, instead of putting names, get the folder of your items.
[ServerStorage isn’t available to clients in-game]

1 Like

I will try that out in a bit and get back to you, thanks!

1 Like