Here’s an example of something you may be wanting using a BindableEvent:
-- Script1
local add_amount = 1
function add(n)
return n + add_amount
end
BindableEvent.Event:Connect(function(x)
add_amount += x
end)
-- Script2
function increase(x)
BindableEvent:Fire(x)
end
Whenever the BindableEvent is fired by the invocation of the increase function in Script2, the variable add_amount in Script1 will increase by the value sent through the increase function. You are essentially communicating across multiple scripts.
You can also use a ModuleScript or a IntValue to achieve the same effect; there are multiple ways to approach this.
just to clarify further for you, you can just not send variables you won’t use from that specific point of calling your function aka:
local function something(info)
local cframe = info.cframe
if info.DelayedCFrame then
task.wait(1)
part.CFrame = cframe
else
part.CFrame = cframe
end
end
something1({cframe = cf, DelayedCFrame = true})
--or
something1({cframe = cf})
this way you can use only what you need in functions without extra arguments or complications…