Hello ive been trying to make a horror game and i wanted to make a command that makes all of the lights tween to the color red but for some reason the result is not smooth and i dont know what i could do"
this is my script
game.Players.PlayerAdded:Connect(function(plr)
if plr.Name == "nikos300" then
plr.Chatted:Connect(function(msg)
if msg == "/e troll" then
task.spawn(function()
script.Parent:Play()
script.Parent.Volume = 0
game:GetService("TweenService"):Create(script.Parent,TweenInfo.new(1,Enum.EasingStyle.Linear),{Volume = 1}):Play()
game:GetService("TweenService"):Create(game.Lighting,TweenInfo.new(1,Enum.EasingStyle.Linear),{Ambient = Color3.fromRGB(75,0,0)}):Play()
task.wait(45)
game:GetService("TweenService"):Create(script.Parent,TweenInfo.new(0.5,Enum.EasingStyle.Linear),{Volume = 0}):Play()
game:GetService("TweenService"):Create(game.Lighting,TweenInfo.new(1,Enum.EasingStyle.Linear),{Ambient = Color3.fromRGB(75,75,75)}):Play()
task.wait(0.5)
script.Parent:Stop()
end)
for i,v in pairs(workspace:GetDescendants()) do
task.spawn(function()
if v:IsA("Model") and v.Name == "Light" then
task.spawn(function()
for i,v in pairs(v:FindFirstChild("Light").SurfaceLight:GetChildren()) do
if v:IsA("Script") then
v.Disabled = true
end
end
end)
local SelectedColor = Color3.fromRGB(220, 0, 0)
game:GetService("TweenService"):Create(v:FindFirstChild("Light").SurfaceLight,TweenInfo.new(1,Enum.EasingStyle.Linear),{Color = SelectedColor}):Play()
game:GetService("TweenService"):Create(v:FindFirstChild("Light"),TweenInfo.new(1,Enum.EasingStyle.Linear),{Color = SelectedColor}):Play()
--v:FindFirstChild("Light").SurfaceLight.Color = Color
--v.Light.Color = Color
task.wait(45)
local SelectedColor = Color3.fromRGB(230, 225, 61)
game:GetService("TweenService"):Create(v:FindFirstChild("Light").SurfaceLight,TweenInfo.new(0.5,Enum.EasingStyle.Linear),{Color = SelectedColor}):Play()
game:GetService("TweenService"):Create(v:FindFirstChild("Light"),TweenInfo.new(0.5,Enum.EasingStyle.Linear),{Color = SelectedColor}):Play()
--v:FindFirstChild("Light").SurfaceLight.Color = SelectedColor
--v.Light.Color = SelectedColor
task.spawn(function()
for i,v in pairs(v:FindFirstChild("Light").SurfaceLight:GetChildren()) do
if v:IsA("Script") then
v.Disabled = false
end end
end) end) end) end end end) end end)