Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

API integration failure?

Asked by 8 years ago

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

Log in to vote
1
Answered by
Mokiros 135
8 years ago

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)
0
Okay, I've already done that. Now it's saying API is not a valid member of ServerScriptService. WelpNathan 307 — 8y
0
Oh, i forgot! Locals can't access ServerScriptService! Put API into ReplicatedStorage instead! Mokiros 135 — 8y
0
Thanks. WelpNathan 307 — 8y
Ad

Answer this question