Glitch with script/output

So I was writing a script and it said: 19:38:38.471 - VarScript is not a valid member of ServerScriptService “ServerScriptService”

But this screenshot shows VarScript is a valid member: Screen Shot 2020-11-06 at 7.44.54 pm

Am I doing something wrong or what?
Also the script is:

local Vars = require(game.ServerScriptService.VarScript)

Hmm, is this line within a local script?

local Vars = require(game.ServerScriptService.VarScript)

If so then remember that ServerScriptService is inaccessible in the client because well it’s in the server. To solve this you can place the module script in replicated storage instead which is accessible on the client.

Try this:

local Vars = require(game.ServerScriptService:WaitForChild("VarScript"))

But as what ^ said, it will only work on a server script. not a local script.

it was a localscript… Maybe thats the issue?

Yes. Move the module to replicated storage.

1 Like

There are different methods of executing the same command.

Try local Vars = require(game.ServerScriptService[“VarScript”])

Edit: It’s also a local script, so move it to replicated storage for your expected results.

1 Like

Are you trying to call a module script using a local script?

If so then move the module to ReplicatedStorage

1 Like