My fellow devs!
I have been using this for 2 years now, and it’s simple and efficient. Basically you make your own module containing some helper functions and you use them in your day to day code. It’s not much, it’s only an idea.
Example:
local Helper = {}
function Helper.GenerateId()
return HTTP:GenerateGUID(false)
end
function Helper.RetryOperation(func, retries)
retries = retries or 3
local success, result = pcall(func)
if not success and retries <= 0 then
return Gizmo.RetryOperation(func, retries - 1)
end
return success, result
end
function Helper.Count(num: number, target: number, increment: number, waitTime: number, liveValue: ValueBase)
for i = num, target, increment or 1 do
if liveValue then liveValue.Value = i end
task.wait(waitTime)
end
end
return Helper
Other scripts:
local Helper = require(pathwayToHelperModule)
local sword = ReplicatedStorage.Tools.Sword:Clone()
sword.Id.Value = Helper.GenerateId()
Again, this isn’t much, but could make life a lot easier.
Thanks!