Hi, I’m trying to make a product purchase script and I was wondering how to do this. I don’t want to make an event connection and then disconnect if I can just wait() for it. But however, I don’t know how to get the parameters, does anyone know how to do this?
Example, turn this:
part.Touched:Connect(function(hit)--hit is parameter
--asdoaisjdsae
end
Into this?:
part.Touched:Wait() --Where do I put hit?
--aslfhauhfauf
--In this scenario if a 4th parameter is returned, it wont be stored
--So for this example you must know the amount of parameters returned
local a, b, c = event:Wait()
If it returns multiple parameters and you don’t know how many:
--Basically convert the tuple to an array
local params = {event:Wait()}
for i, v in pairs(params) do
print("params["..i.."] =", v)
end