Im trying to make a tool that removes a specific model when they collide with each other but I keep getting this error message in the output. How can I fix this?
local tool = script.Parent local handle = tool:WaitForChild("Handle") local w = workspace:GetChildren()
tool.Activated:Connect(function() local str = Instance.new("StringValue") str.Name = "toolanim" str.Value = "Slash" str.Parent = tool wait(2) end)
handle.Touched:Connect(function(hit) if w[hit].Name == "mushroom 1" then w[hit]:Remove() wait(30) end end)

1 comment
Please codeblock your code: select your code and then press the blue "lua" circle to codeblock it. It makes it easier to read.