Repeat wait until touched help

Like the title says I am trying to repeat wait() until tool touches part.
This is usually what I do for touch events:

tool.Handle.Touched:Connect(function(touch)
	if touch.Parent==part then
end

However, I need to incorporate the wait() until. So I tried with this line:

repeat wait() until tool.Body.Touched==part

But this line just keeps waiting.
Thanks

RBXScriptSignal:Wait

local t
repeat
  t = tool.Handle.Touched:Wait()
until t.Parent == part

tool.Handle.Touched == part always equals false, and always will, you’re trying to compare an event to an instance

2 Likes

Thank you this is pretty much it. It should be

until t == part
instead of
t.parent == part

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.