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

My lighting script not working right, not changing anything, no errors??

Asked by 5 years ago

I have a local script in lighting and it does absolutely nothing. It doesn't even print. I'm trying to make a script to change the skybox and time when a round starts. I have a skybox in ServerStorage, named "Overcast." The local script is parented to Lighting. Help! Local Script:

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

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"
        script.Parent.ClockTime = 1
    else
        if game.Lighting.Overcast then
            game.Lighting.Overcast:Destroy()
        end
        script.Parent.ClockTime = 12
    end

end)

1 answer

Log in to vote
0
Answered by
Alphexus 498 Moderation Voter
5 years ago

Any script does not run in...

Lighting ReplicatedStorage ServerStorage

Only LocalScripts do not run in Workspace or ServerStorage.

There are a few other places too.

0
Wording it differently: the lighting, server storage, and replicated storage are just place holders. They can hold scripts and other items, but nothing in there will run. royaltoe 5144 — 5y
0
So, where should I put it? StarterGui? NickIsANuke 217 — 5y
Ad

Answer this question