I need to find the tool, not the character.
local Used = script.Parent.Used.Value
script.Parent.Touched:Connect(function(hit)
print(hit.Parent.ClassName)
if hit.Parent:FindFirstAncestorOfClass(“Tool”) then
local CTool = hit.Parent:FindFirstAncestorOfClass(“Tool”)
if Used == false then
Used = true
for i = 5,1,-0.5 do
~~ local PBSpeed = (tostring(math.ceil(math.random(0,1))) … “.” … tostring(math.ceil(math.random(5,9))))
~~ script.Parent.Knife.PlaybackSpeed = tonumber(PBSpeed)
~~ script.Parent.Knife:Play()~~
~~ script.Parent.NameTag.Frame.WaitTime.Text = tostring(math.ceil(i)) … " seconds remaining."
~~ wait(0.5)
~~ end
~~ CTool:FindFirstChild(“Sliced”).Value = true
CTool.Name = “Sliced” … CTool.Name
end
end
~~end)
I edited the script a little, but it still did not work.
This is so weird. It starts to turn me mad ngl.
This is a script that would actually make sense (I hope)
local Used = script.Parent.Used.Value
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local hits = hit.Parent:GetChildren()
for i = 1, #hits do
if hits.ClassName == "Tool" then
print("ToolDetected")
end
end
end
end)