How to add more parameters to connected functions?

This seems to be my question, but, as the replies suggest, it seems clunky and overcomplicated, and its 2022 now, so maybe there’s an alternative solution?

Essentially, what I want is to add more parameters to, say, a touched function. From what I know, connecting a function to a touched event comes with the parameter “hit”, but I also want to pass other information through to it. How do I do that? Do I still have to do the solution mentioned in the post above?

As far as I know, you still have to do it as the solution in the linked post.

Instance.Touched:Connect(function(part)
   CustomTouched(part,part.Name,part.Parent)
end)
1 Like

darn

also is this like, a common thing that people do? or is it just a really jank thing every once in a while that we just gotta do

I see it a lot, in answers to questions here on the forums, to doing it a lot in my own code, to also finding it in various Roblox gears.

So if there is some alternative people are doing, I haven’t ran across it.

I know that you can make ‘classes’ using module scripts, but in my own opinion (and I may be wrong) its sort of the same thing, just making functions to call other Roblox functions, which feels the same if not backwards to this, using Roblox functions to call other functions. Although I don’t have really any experience with that.

1 Like