Should i use one use variables

i have made variables that are only used once, but is it a bad idea to keep making these kinds of variables?

or should i not use them at all?

like this

local CollectionService = game:GetService("CollectionService")
local teleporters = CollectionService:GetTagged("teleporters")

local ServerStorage =  game:GetService("ServerStorage")
local TeleportModule = require(ServerStorage.TeleportModule)

for _,teleporter in pairs(teleporters) do
	TeleportModule.Clone(teleporter)
end

or should i do this?

for _,teleporter in pairs(game:GetService("CollectionService"):GetTagged("teleporter")) do
	require(game:GetService("ServerStorage").TeleportModule).Clone(teleporter)
end

If it’s working perfectly then do what you want.

1 Like

Both works, but I doubt you would get any performance benefit out of it. The first one is more preferable because you can read what each variable contains of.

1 Like