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

How can i turn my drop item script from a "touched" to a proximity prompt activation?

Asked by 2 years ago
Edited 2 years ago

I have been trying to make a proximity prompt on a part where it puts the tool you have in your hand to a different part's position for my shop game. I finally got it working but it is a "touched" function, not a proximity prompt. I've tried changing it and looking for other scripts but this is where i am. Please ignore the "door" and that, it's just what the tutorial had it called ????.

Touched part script:

local door = script.Parent
local ToolSpot = script.Parent.Parent.ToolSpot

local function remove(otherPart)
    local humanoid = otherPart.Parent:FindFirstChild('Humanoid')
    local player = game.Players:FindFirstChild(otherPart.Parent.Name)
    if humanoid and player then
        local inHand = otherPart.Parent:FindFirstChildWhichIsA('Tool')
        if inHand then
            inHand.Parent = game.Workspace
            inHand.Handle.Position = ToolSpot.Position
        end
    end
end
door.Touched:Connect(remove)

Explorer layout:

https://pbs.twimg.com/media/FQFCJnlXEAIaLzT?format=png&name=240x240

Any help appreciated!!!

0
SORRY WORKING LINK: NathanPlays2016 7 — 2y

1 answer

Log in to vote
0
Answered by
extrorobo 104
2 years ago

https://www.youtube.com/watch?v=E0DmIwdQHSo - I highly reccomend this tutorial. if you have anymore questions please message me on roblox.

Ad

Answer this question