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

API integration failure?

So, I've implemented an API from someone and so I'm trying to include the API in my scripts.

The API is located in ServerScriptService and is a MODULESCRIPT.

Below is the code in the STARTERGUI. IT IS ALSO IN A ** LOCALSCRIPT**.

ap = require(game.ServerScriptService.API)

The error message is :

ServerScriptService is not a valid member of DataModel

I'm not sure whether it's because the API is placed in ServerScriptService. I've also tried putting the startergui localscript to be a normal script but that did not help.

ALSO, THE SCRIPT WORKS ON STUDIO, BUT NOT ON THE REAL GAME.

PS: Here's the structure https://gyazo.com/13ef2eeb06153611fc9c7f002ee72fdb.

Thanks! Nathan.

1 answer

✓ Accepted answer

There is no service/storage called "ServerScriptStorage". It must be called "ServerScriptService".

Also, try using game:GetService(string ClassName) to access even renamed services.

ap = require(game:GetService("ServerScriptService").API)

3 comments

0

Okay, I've already done that. Now it's saying API is not a valid member of ServerScriptService.

0

Oh, i forgot! Locals can't access ServerScriptService! Put API into ReplicatedStorage instead!

0

Thanks.

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