Hello,
I recently created this script and changed it around a little. The Loop doesn’t run, and in Output it says, “Attempt to compare string and function”. Any help will be appreciated. The code is as follows (without indents):
local terrain = game.Workspace.Terrain
local time = game.Lighting.ClockTime
local daynight = script.Parent.DayNight.Value
print(“gotpastcode3”)
local colorValue = Instance.new(“Color3Value”)
colorValue.Value = terrain:GetMaterialColor(“Grass”)
colorValue.Parent = script.Parent
print(“gotpastcode2”)
colorValue:GetPropertyChangedSignal(“Value”):connect(function()
terrain:SetMaterialColor(“Grass”, colorValue.Value)
end)
print(“gotpastcode1”)
local tweenInfo = TweenInfo.new(60, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0)
local Night = game:GetService(“TweenService”):Create(colorValue, tweenInfo, {Value = Color3.fromRGB(91, 122, 380 )})
local Day = game:GetService(“TweenService”):Create(colorValue, tweenInfo, {Value = Color3.fromRGB(110, 148, 70)})
print(“got past code”)
while true do
print(“Looped”)
if time >= “21” or 21 then
Night:Play()
print(“Tweened”)
daynight = 1
wait(0.1)
end
if time >= “6” or 6 then
Day:Play()
print"Went back"
daynight = 0
wait(0.1)
end
wait(0.1)
end
R3M1X
Edit 1- the lines that are being mentioned are the if’s