Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Using > and < in a if statement?

So I have a script that makes so if its past 6AM it turns the lights on, but it doesn't seem to work and the > is underlined in red and it says "Expected Identifier"

local Children = game.Workspace.WinLight:GetChildren()

if game.Lighting.ClockTime == >6 then
	for Index = 1, #Children do
		local Child = Children[Index]
		if Child:IsA("BasePart") then
			Child.BrickColor = BrickColor.new("Br. yellowish green")
			Child.Material = "Neon"
			Child.Transparency = 0.7
			Child.Reflectance = 0.1
		end
	end
end

1 answer

✓ Accepted answer

dont use == before the identifier

local Children = game.Workspace.WinLight:GetChildren()

if game.Lighting.ClockTime >6 then
    for Index = 1, #Children do
        local Child = Children[Index]
        if Child:IsA("BasePart") then
            Child.BrickColor = BrickColor.new("Br. yellowish green")
            Child.Material = "Neon"
            Child.Transparency = 0.7
            Child.Reflectance = 0.1
        end
    end
end

3 comments

0

">" is just as much of an identifier as "=" or "=="

0

thanks! I knew this was a rookie mistake

0

it' fine, we all make rookie mistakes sometimes :)

This discussion is preserved as it was. New answers, comments, and votes are closed.