Tool not attaching to hand, and just dropping?

Hello,

I’ve created a tool and it requires a unique hold for the animation to work properly. I’m just trying to get the can to attach to the other arm, since by default its attached to the right hand. Here’s what ends up happening (ignore the dummy):
image
It spawns far from my hand and just drops to the ground. Here’s my code (the holding animation is irrelevant and is placed elsewhere)

local drink = script.Parent
local debounce = false
drink.Equipped:Connect(function()
	print("equipped")
	local drink = script.Parent
	local char = script.Parent.Parent
	local humanoid = char:WaitForChild("Humanoid")
	local animator = humanoid:WaitForChild("Animator")
	local player = script:FindFirstAncestorWhichIsA("Player") or game:GetService"Players":GetPlayerFromCharacter(char)
	
	for i, object in pairs(char:GetChildren()) do
		if object:IsA("WeldConstraint") then
			object:Destroy()
		end
	end
	
	char.DescendantAdded:Connect(function(object)
		if object:IsA("Weld") and object.Name == "RightGrip" then
			task.wait()
			object:Destroy()
		end
	end)
	--drink.Handle.Position = char.LeftHand.LeftGripAttachment.OriginalPosition.Value
	drink.DrinkModel.Handle.Position = char.LeftHand.Position
	--drink.DrinkModel.PartThing.Position = char.LeftHand.LeftGripAttachment.OriginalPosition.Value
	--drink.DrinkModel.Part.Position = char.LeftHand.LeftGripAttachment.OriginalPosition.Value
	
	local weld = Instance.new("WeldConstraint")
	weld.Parent = drink
	weld.Part0 = char.LeftHand
	weld.Part1 = drink.DrinkModel.Handle
	drink.Parent = char
	
	
	
	drink.Activated:Connect(function()
		if debounce == false then
			debounce = true
			local drinkanim = Instance.new("Animation")
			drinkanim.Parent = player
			drinkanim.AnimationId = "rbxassetid://12607085910"
			local drinkanimtrack = animator:LoadAnimation(drinkanim)
			drinkanimtrack:Play()
			drinkanim:Destroy()
			humanoid.WalkSpeed = 32
			task.wait(5)
			humanoid.WalkSpeed = 16
			task.wait(5)
			debounce = false
		end
	end)
end)

Note that the print statement doesn’t run, yet I can still “equip” it by pressing 1 (the tool GUI)

2 Likes

bumpbumpbumpbumpbumpbumpbumpbump this is a complete sentence

this is in fact a complete sentence and I am yet again bumping this because im quite frustrated with this specific script (i hate working with tools and toolgrips, its quite tedious) :angry:

does it have the same behaviour when the script is disabled?

1 Like

Yup, exact same thing even with the script disabled. Quite strange…

Now I’m getting this error whenever I mess around with my script…
ValtryekRBLX's commit failed with internal error: Publish Assets - Http status error (502) HTTP 502 (Bad Gateway), response body ''

why are you setting the position of the tool to the players hand, shouldn’t that happen automatically?

no because, as I said, I’m trying to get it to the left hand, not the right hand, which is the default.

use tool grip plugin in roblox studio

That is irrelevant and won’t help this. Tool Grip Editor only edits the position of the tool on the right hand. It has nothing to do with the left hand and can’t help you with the animation or the problem I’m facing right now.

Fixed! It’s cause the handle wasn’t a direct descendent of Tool.

1 Like

See status.roblox.com - servers are down

Now they are back up to my knowledge.

1 Like

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