Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I add an item pickup script? (not like a tool)

Asked by 3 years ago

Im trying to make a puzzle room where you are small and need to pick up parts by holding down your mouse on them and dragging them to form a staircase, but i dont know how to do an item pickup script like that, since i dont want it to become a tool that you get.

0
You want it to float on the air in mouse position or you want it to became attached to your hands? Necro_las 412 — 3y
0
i want it to float in the spot of the players mouse position legolover54721 -13 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Add a ProximityPrompt into your part and then duplicate it, convert it into a tool, store them in ServerStorage. Create a script inside the ProximityPrompt thing and paste the following code in it:

local proxi = script.Parent
local part = script.Parent.Parent
local clonepart = game.ServerStorage["Your Clone's Name"]
local player = game.Players.LocalPlayer
proxi.Triggered:Connect(function()
    part:Destroy()
    clonepart.Parent = player.Backpack
end)

Hope it works

P/s : My English is bad so yea

0
Lemme try that legolover54721 -13 — 3y
0
Few questions, when you say them, do you mean both parts and two do i do this to both parts legolover54721 -13 — 3y
Ad

Answer this question