hi i want to return out of a function when i click
this is kind of an example of what i want to do
local uis = game:GetService("UserInputService")
function whatiwanttomakework()
uis.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
return "heyeasdrfds"
end
end)
end
function whatidonotwanttodo()
local value
uis.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
value = "hi"
end
end)
for i=1, 30 do
if value then
break
else
wait(1)
end
end
return value
end
function theonewhereineedittoreturnto()
local str = whatidonotwanttodo()
print(str)
end
how would i make the function whatiwanttomakework return whenever i click
my current method is the method i showed in the function whatidonotwanttodo and i dont want to do it because it has delay and i dont want that
ok bye bye