How to find a specific player in workspace through script in a part?

So i wanted to make a proximity promt that if a player interacted with a tool in his hands will it get removed and the player will progress to repair the bridge that i made. However i need to find the player who is interacting with the bridge in workspace(because the tool i want to remove is not in the backpack any more) but i have no idea how to acces the player(who interacted with the prompt not all players obviously) in workspace.


i removed most of the code because i realised it was wrong

Screenshot 2025-04-08 181655

and if you ask waht my goal is i try to make that the player whos interacting with the bridge “places the crate” in this location to give the felling he acctually placed it.

example:



i really just need to know how to find this player who interacted with it in workspace and i will have Zero problem completing the rest of the script i litterly went through 20 post already to find out how to do it.
Thank you :slightly_smiling_face:

instead of user.Parent is it not just user?

and then user.Humanoid:UnequipTools() i think

local Part = script.Parent
local Prompt = part.ProxPrompt

local ToolName = "Crate"

Prompt.Triggered:Connect(function(plr)
local backpack = plr.Backpack
if backpack:FindFirstChild(ToolName) then
backpack:FindFirstChild(ToolName):Destroy()
end
end)

well the problem is that the tool if equipped is not in the backpack any more its in the workspace so that means it wont be removed if you try to fin it in backpack

local Part = script.Parent
local Prompt = part.ProxPrompt

local ToolName = "Crate"

Prompt.Triggered:Connect(function(plr)
local backpack = plr.Backpack
if backpack:FindFirstChild(ToolName) then
backpack:FindFirstChild(ToolName):Destroy()
end

if plr.Character:FindFirstChild(ToolName) then
plr.Character:FindFirstChild(ToolName):Destroy()
end

end)

if you meant character, there its fixed. but if you really meant workspace, you may need a way to link the tool to the player, like an attribute for ownership

it works now i can finish the script
Thank You :saluting_face:

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