Slash error in Tool

Well, my problem is that in line 10, in the part of if NoTala.Value == false then a slash should be done, but it doesn’t, it just gives the print that I put.

local PlayAnim = script.Parent:WaitForChild("PlayAnim")
local Value = script.Parent:WaitForChild("Acción")
local Debounce = false
local Debounce2 = false
local tool = script.Parent
local NoTala = script.Parent:FindFirstChild("TalarArbolAnim")

local function mine()
	print("neutro")
	if NoTala.Value == false then
		if not Debounce then
			Debounce = true
			local str = Instance.new("BoolValue", script.Parent)
			str.Name = "toolanim"
			str.Value = "Slash"
			wait(0.2)
			Debounce = false
			print("not lumber")
			str:Destroy()
		end
	elseif NoTala.Value == true then
		if not Debounce2 then
			local Character = script.Parent.Parent
			local AnimationTrack = Character:WaitForChild("Humanoid"):LoadAnimation(PlayAnim)
			Debounce2 = true
			AnimationTrack:Play()
			wait(0.21)
			Value.Value = true
			AnimationTrack:Stop()
			wait(0.2)
			Value.Value = false
			wait(0.1)
			Debounce2 = false
			print("lumber")
		end
	end
end

tool.Activated:Connect(mine)

What is NoTala suppose to be? An animation or a BoolValue?

1 Like

NoTala is a Bool Value to change from slash to animation

local str = Instance.new("BoolValue", script.Parent)

str.Name = "toolanim"
str.Value = "Slash" -- no

You created a BoolValue. BoolValue is only true or false. You can’t give it a specific type of “named” value. If you want to give it a named value, create a StringValue using Instance.new()

local str = Instance.new("StringValue")

mmm, I don’t think that’s the problem because I already tried it with another normal tool just with:

local tool = script.Parent

local function mine()
local str = Instance.new("StringValue", script.Parent)
str.Name = "toolanim"
str.Value = "Slash"
end

tool.Activated:Connect(mine)

and works.

Nevermind, I found the Value thing. And I just noticed, where is the part that turns the NoTala value to true?

I don’t do that part yet because I plan that I changed the value from another script with the Touched function