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
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.
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
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