Hello!
So recently i have gotten trouble in making a part when touched change the entire atmosphere for the client, but the code doesn’t “ignite”, it just doesn’t change or start
i tried recurring for remoteevents but no success
There’s a part called “RainTrigger” inside a folder called “RainParts”, with a Script and a LocalScript
Here’s both codes for analysis
LocalScript
local TS = game:GetService("TweenService")
local lighting = game:GetService("Lighting")
local Atmosphere = game.Lighting.Atmosphere
local skyboxFolder = lighting.Skyboxes
local rainSkybox = skyboxFolder.RainySky
local normalSky = lighting.NormalSky
local remoteEvent = game.ReplicatedStorage.ChangedAtmosphere
remoteEvent.OnClientEvent:Connect(function()
TS:Create(lighting.Ambient, TweenInfo.new(3), {Color3.new(62, 62, 62)}):Play()
TS:Create(lighting.Brightness, TweenInfo.new(3), {0.5}):Play()
TS:Create(lighting.OutdoorAmbient, TweenInfo.new(3), {Color3.new(84, 84, 84)}):Play()
TS:Create(lighting.ClockTime, TweenInfo.new(3), {12}):Play()
TS:Create(Atmosphere.Density, TweenInfo.new(3), {0.475}):Play()
TS:Create(Atmosphere.Color, TweenInfo.new(3), {Color3.new(147, 147, 147)}):Play()
TS:Create(Atmosphere.Decay, TweenInfo.new(3), {Color3.new(92, 92, 92)}):Play()
TS:Create(Atmosphere.Glare, TweenInfo.new(3), {0}):Play()
TS:Create(Atmosphere.Haze, TweenInfo.new(3), {10}):Play()
rainSkybox = lighting
normalSky = skyboxFolder
end)
Script
local debounce = false
script.Parent.Touched:Connect(function(otherPart)
local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
if player then
if debounce then return end
debounce = true
game.ReplicatedStorage.ChangedAtmosphere:FireClient(player)
task.wait(3)
debounce = false
end
end)