79303999

Date: 2024-12-23 19:16:45
Score: 0.5
Natty:
Report link

Solution

You can place a NumberValue in ReplicatedStorage, which can be accessed by both server scripts and local scripts. If you want it to be accessible only by server scripts, use ServerStorage instead.


Demonstration

As a demonstration, place a NumberValue in ReplicatedStorage as shown:

BarierNumber in ReplicatedStorage

Create two server scripts, the first named "Primary Script", and the second named "Other Script":

game.ReplicatedStorage.BarierNumber.Value = 123
print("Primary Script:", game.ReplicatedStorage.BarierNumber.Value)
print("Other Script:", game.ReplicatedStorage.BarierNumber.Value)

Then, create a local script called "Local Script":

print("Local Script:", game.ReplicatedStorage.BarierNumber.Value)

Then, run the game and notice that all scripts retrieve the correct value:

The console showing all scripts printing the correct value


GitHub Gist Link

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: The Empty String Photographer