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

MainScript is not a member of ServerScriptService? Nani?

Asked by 4 years ago

So I'm making a loading screen for my game with a button that enables the main script which is in ServerScriptService

Apparently, according to my output, MainScript is not a valid member of ServerScriptService. My explorer tab says otherwise.

The following script is written in a LocalScript inside of the ScreenGui that is my loading screen.

script.Parent.MouseButton1Up:Connect(function()
    script.Parent.Visible = false --This is working fine.

    game.ServerScriptService.MainScript.Disabled = false --This is NOT working fine.
end)
0
unfortunately LocalScripts cannot access ServerScriptService TheBigBro122 427 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

As TheBigBro122 said, LocalScripts cannot access the server, although to get around that problem you could use RemoteEvents and fire it from the LocalScript and then on the server end check when the event is fired and enable the server script.

Ad

Answer this question