Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Help with variables in modules?

Asked by
imKirda 4491 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

So i have some modules, i also have a services module (it stores all the services) that is stored in ReplicatedStorage. One of my modules gets errors from output and posts them on my discord, here is example:

function module:postError(webhook, message, `httpService`)
    httpService:posterrorBlaBlaBla
end

well so what i am talking about now is the http service as a variable in the function, my question is if it is good to send the http service from the main script like i made through function everytime i call it, or should i require the services module and create a local variable for it in the module?

Thanks, kirda

1 answer

Log in to vote
1
Answered by 4 years ago

Pretty sure its better to require the services module and create a local variable for it, also dont use ":" if ur not going to use self

0
Thanks imKirda 4491 — 4y
Ad

Answer this question