Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is it possible to have one function that fires for multiple events?

Hello!

Lately I've been doing some GUI work. Though once I was done with it and was ready to create the GUI, I ran into an efficiency problem.

I have several frames that I need to tween the size and position of. Instead of using separate functions for each frame, could I condense it into one function that works for all of the frames?

Thanks, all replies are appreciated.

2 answers

All I could think of is making one function and then connecting them to different events using event:connect(function) I can't tell you if that'll work but it's worth a try.

Try using the Spawn function ex.

Function Start() Spawn(function() print("Hello World") end) Spawn(function() print("This was printed at the same time as the one above") end) end

Output:

Hello World This was printed at the same time as the one above

This discussion is preserved as it was. New answers, comments, and votes are closed.