Hi, I'm currently making a sword and I have a problem where Handle is not a valid member of tool when it clearly is. Is it maybe due to a Roblox update which broke it because it has worked before and I have not changed the script in anyway. Please help
Local Script:
script.Parent.Equipped:Connect(function()
local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Animations.Idle)
idle:Play()
script.Parent.Unequipped:Connect(function()
idle:Stop()
end)
end)
local UserInputService = game:GetService("UserInputService")
local Tool = script.Parent
local CanAttack = true
local Anim_Name = "Attack"
local Audio = script.Parent.Handle.Swing
local Attack_Animations = script.Parent:WaitForChild("Animations")
local Attack_Num = 1
local blade = script.Parent.SwordBlade
blade.Touched:Connect(function(hit)
if CanAttack == false then
game.ReplicatedStorage.Damage:FireServer(hit)
end
end)
UserInputService.InputBegan:Connect(function(InputObject)
if InputObject.UserInputType == Enum.UserInputType.MouseButton1 then
local Animation = script.Parent.Parent.Humanoid:LoadAnimation(Attack_Animations[Anim_Name..Attack_Num])
if CanAttack == true then
CanAttack = false
Animation:Play()
Audio.PlaybackSpeed = math.random(0.9,1.1)
Audio:Play()
blade.Trail.Enabled = true
wait(0.5)
CanAttack = true
blade.Trail.Enabled = false
if Attack_Num == 1 then
Attack_Num = Attack_Num + 1
else if Attack_Num == 2 then
Attack_Num = 1
end
end
end
end
end)

2 comments
What line is it erroring at?
Line 14