So I have a function, and if it is running, then I want to trigger a piece of code. But I don't really know how to call my function. I haven't tried anything because I couldn't find anything. So please help. Thanks!
EDIT: The code that I want to be triggered, is the following.
for key, value in pairs(workspace:GetDescendants()) do
if value.Name == "car" then
value:Destroy()
end
end

4 comments
why not just call the function in that function that is running? You could also use simple bool variables to do this.
can you please show me how?
i cant really call the function in the function that is running because then the whole script will fall apart. So if the function is running, then only will the code be triggered
but listen, i can put it in the function if you get a way to find all of the models with the same name without having to use a for loop