Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

error message says a part isnt a part of the tool when its clearly is what is going on?

Asked by 4 years ago
Edited 4 years ago

so basically whenever I run the code I get the error message of BLADEPART1 is not a valid member of Tool "Players.MrAspuru.Backpack.Anakin's Lightsaber"

I don't understand this as it is clearly a part of the tool I don't know how to add images to this but BLADEPART1 is in the tool here is the script which is showing the error message the error message says it's from line 116

001attacksequencenumber = 0
002local enabled = true
003sound1 = game.Workspace.Sound11
004sound2 = game.Workspace.Sound21
005sound3 = game.Workspace.Sound31
006sound4 = game.Workspace.Sound41
007sound5 = game.Workspace.Sound51
008tool = script.Parent
009damagecooldown = false
010local ReplicatedStorage = game:GetService("ReplicatedStorage")
011 
012local remoteEvent = ReplicatedStorage:WaitForChild("Damage")
013 
014 
015local playerer = script.Parent.Parent
View all 187 lines...

1 answer

Log in to vote
0
Answered by 4 years ago

I fixed it i just had to replace script.parent.BLADEPART1 with script.parent:WaitForChild("BLADEPART1")

Ad

Answer this question