Can events be used by an if/then statement?

So I was making a finisher for a combat system and I was wondering:

Can you use an event(not remote events or bindable events) in an if/then statement?

If you know the answer, please do reply! :smiley:

Yes, that’s correct, you can 100% do this.
Good luck on your project!

I mean you can but what do you mean by that exactly? Are you talking about this:

if event:Connect(function) then

end

or this:

if statement then
event:Connect(function)
end

or entirely something else?

I’d be willing to bet the ladder is what he’s refering to. Bad phrasing though lol.

Hey @GabNoob52!

So assuming you’re talking about connecting an event after an if statement, uh yeah that’s totally possible but I wouldn’t reccomend it on code that can be called more than once, you’ll create a memory leak and that’s no fun.

Hope this helps!