Please explain in depth.
If both are Scripts or both are LocalScripts, you can use ModuleScripts (otherwise, look up RemoteEvents and RemoteFunctions - there's even guides on ScriptingHelpers at the top of the page).
ex:
--ModuleScript named "Module" in ReplicatedStorage local module = {} module.var = 0 return module --Script 1 local module = require(game.ReplicatedStorage.Module) module.var = 10 wait(1) print(module.var) -- 20 because of what Script 2 does --Script 2 local module = require(game.ReplicatedStorage.Module) wait(0.5) print(module.var) -- 10 module.Var = 20
Of note, you cannot change the value of a local variable in another script. That is, if Script #1 has local var = 5
, you cannot change that value directly from a different script.