How to make tool pickup with ProximityPrompt! | Useful for FPS games
1) Make a part inside workspace | game.Workspace
Name it however you want
2) Make a ProximityPrompt inside the Part
**3) Make a Server Script inside the ProximityPrompt
4) Make a tool and put it in ReplicatedStorage | game.ReplicatedStorage
In our case is Pistol
5) Lets script!
script.Parent.Triggered:Connect(function(plr) -- Detects if the ProximityPrompt is triggered
game:GetService("ReplicatedStorage"):WaitForChild("YourTool"):Clone().Parent = plr.Backpack -- Change "YourTool" to your tool name!
end)
6) Trigger Ended
You can make the part destroy whenever the player triggered the part and got the tool.
You dont need to make it.
script.Parent.TriggerEnded:Connect(function() -- Checks if the ProximityPrompt is triggered
script.Parent.Parent:Destroy() -- Destroys the part
end)
If you need any help feel free to ask!