Hello! Currently, I have a script for when a player touches a part it changes the sky. It works! but not all the time. I figure it would be easier to activate when a script sees that “insert map here” has been added to the workplace. How would I go about doing this?
Here is the current script I am using:
local Lighting = game:GetService("Lighting")
local Skyboxes = game.Lighting.Skies
local DefaultSky = game.Lighting.Spawn
local SFOTHSky = game.Lighting.Skies.SFOTH
local ServerStorage = game:GetService("ServerStorage") --Use ServerStorage instead of lighting!
local Players = game:GetService("Players")
local Tool = game.ServerStorage.Tools.Class
script.Parent.Touched:Connect(function()
task.wait(1.5)
game.SoundService.TheGreatStrategy.Playing = false
game.SoundService.SFOTHTheme.Playing = true
local function skyChange()
SFOTHSky.Parent = Lighting
DefaultSky.Parent = Skyboxes
end
skyChange()
end)
Thanks for any help!!!