Why wont this Tool unequip script work?

  1. What do you want to achieve? I’m trying to make a script that, when a tool is unequipped, it will change the transparency of all body parts and change WalkSpeed.

  2. What is the issue? I made 2 print statements to check what parts were and weren’t working. 1 was for when the tool was unequipped, and the other was when I got the players character. It printed the first one but not the second.

  3. What solutions have you tried so far? I searched it up on Google but got nothing.

script.Parent.Unequipped:Connect(function()
	print("Working 1")
	local Player = script.Parent.Parent.Parent
	local Character = Player.CharacterAdded:wait()
	print("Working 2")
	Character:FindFirstChild("Humanoid").WalkSpeed = 14
	Character:FindFirstChild("LeftFoot").Transparency = .1
	Character:FindFirstChild("LeftHand").Transparency = .1
	Character:FindFirstChild("LeftLowerArm").Transparency = .1
	Character:FindFirstChild("LeftLowerLeg").Transparency = .1
	Character:FindFirstChild("LeftUpperArm").Transparency = .1
	Character:FindFirstChild("LeftUpperLeg").Transparency = .1
	Character:FindFirstChild("LowerTorso").Transparency = .1
	Character:FindFirstChild("RightFoot").Transparency = .1
	Character:FindFirstChild("RightHand").Transparency = .1
	Character:FindFirstChild("RightLowerArm").Transparency = .1
	Character:FindFirstChild("RightLowerLeg").Transparency = .1
	Character:FindFirstChild("RightUpperArm").Transparency = .1
	Character:FindFirstChild("RightUpperLeg").Transparency = .1
	Character:FindFirstChild("UpperTorso").Transparency = .1
	Character:FindFirstChild("Head").Transparency = .1
end)

This is the entire script, and there are no errors in the output.

local Character = Player.CharacterAdded:wait()

If the first print is working im pretty sure its this. Just do Player.Character:Wait() or Player.Character instead. (Player.Character won’t mess up the script because they got the tool which means they must be loaded in, but i would suggest using Player.Character:Wait() for safety if anything happens.)

1 Like