Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Pick up + Place Down system?

Basically, i'm remaking Hello Neighbor. However, I can't, for the life of me, figure out how to make a pick up and place down system. I've tried using mouse.hit, but when it does get placed into the world, it just acts like it got removed like you just remove it from your backpack. Here's what i have so far.

script.Parent.Parent.Activated:Connect(function()
	local finish = game.Players.LocalPlayer:GetMouse().Hit.p
	script.Parent.Parent.Parent = game.Workspace
	wait()
	script.Parent.Position = finish
end)

1 answer

You're removing it from the game, like :Destroy() you have to use something like this:

script.Parent.Parent.Activated:Connect(function()
    local hit = game.Players.LocalPlayer:GetMouse().Hit -- using the cframe here, but just to let you know CFrame.p is deprecated and you should use CFrame.Position instead.
    local clone = script.Parent.Parent.Parent:Clone()
    clone.Anchored = true
    clone.CFrame = hit
    clone.Parent = workspace
end)

P.S. if you need anymore help, contact me at [ throw 32#9470 ]

This discussion is preserved as it was. New answers, comments, and votes are closed.