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

LocalScripts aren't working with ServerStorage?

In LocalScripts I can't access things like ServerStorage, ServerScriptService, or Players sometimes. Is this just something that happens, or is it a bug? (I'm making an admin GUI, but it's finished) Hope someone can help here.

game:GetService("ServerStorage")
game.ServerStorage:FindFirstChild("adminGUIdb")
bin = script.Parent
function Click()
	local gui = game.Workspace.adminGUI2 --See, I must use Workspace in a LocalScript
	local p = game.Players.LocalPlayer
	if bin.open.Value == 0 then
		gui:Clone().Parent = p.PlayerGui
		script.Parent.Text = "Close R1"
		bin.open.Value = 1
	elseif bin.open.Value == 1 then
		p.PlayerGui.adminGUI2:Destroy()
		script.Parent.Text = "Open R1"
		bin.open.Value = 0
	end
end

bin.MouseButton1Click:connect(Click)

I can access Workspace, and that is my current method. EDIT: I am using a LocalScript.

3 comments

0

You aren't suppose to be able to access ServerStorage or ServerScriptService with localscripts

0

Use ServerScripts. LocalScripts are supposed to be in StarterGui,StarterPack,orStarterPlayer.

1 answer

✓ Accepted answer

Local scripts cannot access ServerStorage or ServerScriptService. It is in the name of both "Server", you have to use a server script to access these items.

1 comment

0

I had this before. Instead of putting the GUI into server storage, put it into ReplicatedStorage. Only non local scripts (server scripts) can access the ServerStorage and ServerScriptService.

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