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

Script can't access anything in ServerStorage???

My LocalScript in StarterGui errors "Stormy_Sky is not a valid member of ServerStorage" when it is. LocalScript:

local Status = game.ReplicatedStorage:WaitForChild("Status")
local clonedSky

if game.ServerStorage.Stormy_Sky then
	print("Yes.")
end
Status:GetPropertyChangedSignal("Value"):Connect(function()
	
	if Status.Value == "Game in progress." then
		clonedSky = game.ServerStorage.Overcast:Clone()
		print(clonedSky)
		clonedSky.Parent = game.Lighting
		clonedSky.Name = "Overcast"
		game.Lighting.ClockTime = 1
	else
		if game.Lighting.Overcast then
			game.Lighting.Overcast:Destroy()
		end
		game.Lighting.ClockTime = 12
	end
	
end)

Do I need to change it to a Script?

PS. It won't print "Yes."

6 comments

0

Explanation: I want this script to change the sky and time when a round starts.

0

put what ever you want it to get in the lighting

3

A localscript is a client sided script. If you are wanting to access serverstorage(this is serversided) you need to either be in a script or use a remote event.

0

Put it in Replicated Storage as this replicates to the client and allows the client to access it.

0

i put an answer, see if it helps.

0

It doesn’t need to be a local script. Also, @AlbertoMiAmigo2 I want it to change the sky box between default (no skybox) and Stormy_Sky

3 answers

ServerStorage is for the server only, so localscripts are not able to access it. Localscripts do, however, have access to replicated storage. If what you are doing needs a localscript to work, you should use a remote event.

edit: If it doesn't need to be a localscript then make it serverside and leave it as is.

1 comment

0

Best answer here. Ignore below answers as they are impractical

Strange, I've been testing works yes ! try putting the script in ServeScriptService

PRINT: http://prntscr.com/p8pj9b

1 comment

0

Put it in Replicated Storage as this replicates to the client and allows the client to access it.

is it a local script?

when yes, local scripts can't acces serverstorage.

use a Script instead or put it in replicatedstorage

2 comments

0

give an alternative

0

script

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