Hello , I have a script inside a part and a local script inside a tool, the part script is programed to change a boolVariable to true when touched, the tool script is programed to print “true” if the tool is touched by the part while the bool value is set to true, it works but until the second time I touch it since the first time I touch it with the tool I get “false” and until the second time I get
“true”, I tried to add a wait() on the tool script to wait for the value to change but it still doesn’t work any Ideas on how i could fix this?
Thanks for the help!
Part Script
script.Parent.Touched:Connect(function(hit)
script.Parent.TouchedPart.Value = true
end)
Tool Script
script.Parent.HitPart.Touched:Connect(function(hit)
if hit.Name == "Part" then
wait(.1)
if hit.TouchedPart.Value == true then
print("true")
else
print("false")
end
end
end)