Tool will not move from players inventory to a target part

How would I make a tool dissapear from the players inventory, then place the tool onto a target part, preform an action, and then re-appear in the players inventory. This will all be done with a proximity prompt.

Issue: I cant get the function to change the position of the bucket. Video attached

I have tried parenting it to the workspace and making the bucket CFrame equal to the TargetPart CFrame. But nothing seems to work…

Script provided is a snippet of the one provided in the video.

local function onPromptActivated(player)
	if not toolEquipped and player.Character and player.Character.Parent then
		local tool = player.Character:FindFirstChild("Bucket")
		local bottom = tool:FindFirstChild("Handle")
		if tool then
			print("Sucess!")
			bottom.Anchored = true
			tool.Parent = game.Workspace
			tool.Grip = CFrame.new(targetPart.CFrame.Position)
		end
	end
end

prompt.Triggered:Connect(onPromptActivated)

Also this is my first post ever kek

Try to change not Grip, but CFrame of PrimaryPart or Handle of tool.

1 Like


I could be completely misunderstanding you here but i believe this is what you meant.

tool.PrimaryPart = CFrame.new(targetPart.CFrame.Position)
tool.PrimaryPart.CFrame = targetPart.CFrame
1 Like

Oh my… that works. I feel so stupid lmao. Thank you so much dude, i reckon ican do the rest myself.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.