Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

ServerScriptService is not a valid member of DataModel. What am I doing wrong?

I'm getting this error. What am I doing wrong?

20:59:14 -- ServerScriptService is not a valid member of DataModel
  Stack Begin
  Script 'Players.Exadide.Backpack.Handucuffs.Handcuffs', Line 5
Stack End|

The line in error is

local databaseModule = require(game.ServerScriptService.DatabaseModule)

4 comments

0

Use game:GetService("service name here"). Because sometime, some services maybe not loaded. https://developer.roblox.com/api-reference/function/ServiceProvider/GetService

0

Should it be local databaseModule = game:GetService("ServerScriptService").DatabaseModule ?

0

You do it right :D

0

Oh wait, if you try to require the module, wrap the link like this: local databaseModule = require(game:GetService("ServerScriptService").DatabaseModule)

1 answer

You should do

local databaseModule = require(game:GetService('ServerScriptService').DatabaseModule)

since it's a require

This discussion is preserved as it was. New answers, comments, and votes are closed.