My proximityprompt won't work

Hello!
I’m trying to make a E to pickup a tool but since my game uses proximity prompts i used a proximity prompt

the problem is it wont show up instead it just will sit there do nothing im not sure if its due to it being a tool i don’t get errors though

im stuck because its too specific

local tool = script.Parent
if tool.Parent == workspace then
	
	script.Parent.ProximityPrompt.Triggered:Connect(function()
		local backpack = Plr:WaitForChild("Backpack")
		tool.Parent = backpack
	end)
end
1 Like
local tool = script.Parent
if tool.Parent == workspace then

why do you use tool.Parent for?

Make sure u unAnchor the Tool …

try this

local tool = script.Parent
if tool.Parent == workspace then
	
	script.Parent.ProximityPrompt.Triggered:Connect(function()
		local backpack = Plr:WaitForChild("Backpack")
		tool.Parent = backpack
	end
end)

i think it will work

Why do you place this script into tool, it would be easier to make from Handle since that “Part” where Proximity Prompt UI will be placed

You didn’t declare the “Plr”

script.Parent.ProximityPrompt.Triggered:Connect(function(Plr)
		local backpack = Plr:WaitForChild("Backpack")

You can’t parent a Proximity Prompt to a tool.
It HAS to be a part, model or an attachment. ProximityPrompt | Roblox Creator Documentation

and

Put the proximity prompt into the handle and it will show up.

local tool = script.Parent
script.Parent.ProximityPrompt.Triggered:Connect(function(plr)
           if tool.Parent == workspace then

	tool.Parent = plr.Backpack
           end
end)

Try this

Mine is right
cuz

she put the end with this ) first
like this when u make function u need to do this

proximity.Triggered:Connect(function()
if true then
    end
end) --- u need to put this on last cuz ur making function

Hi there, maybe you could try the API reference:

Anyways, when I make games with ProximityPrompts, I always copy the tool Handle and insert a ProximityPrompt into the handle, this leaves the handle of the tool in the workspace with a prompt that can be triggered.

I then make a folder in ServerStorage that I call Tools, and store every tool there.

I then end up with the following code:

local tool = script.Parent
local ServerStorage = game:GetService("ServerStorage")
local Tools = ServerStorage:FindFirstChild("Tools")

local ProximityPrompt = tool.ProximityPrompt

ProximityPrompt.HoldDuration = .5
ProximityPrompt.ObjectText = "Pickup " .. tool.Name

ProximityPrompt.Triggered:Connect(function(player)
    local NewTool = Tools:FindFirstChild("Baseball Bat"):Clone()
    NewTool.Parent = player.Backpack
end)

Do you have proper line of sight with the proxy? / can you reach it to activate it in the first place, I had the same issue a while back.

its a key that you can pickup so thats why