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
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)
local tool = script.Parent
script.Parent.ProximityPrompt.Triggered:Connect(function(plr)
if tool.Parent == workspace then
tool.Parent = plr.Backpack
end
end)
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
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)