Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

i got error attempt to compare Vector3 <= Vector3?

Asked by 2 years ago

i am trying to make a tub of hot water in my game but i keep on getting that error at line 17

and the script is inside of the water

water is a block not the terrain material water!

---shortcuts
wait(math.random(0.1, 1))
local decrease_per_drain = Vector3.new(0, 1, 0)
local gallons_per_stud = 1900
local gallons_value = script.Parent.gallons_of_water.Value
local drains = script.Parent.Parent.drains:GetChildren()
local drains_open_value = script.Parent.Parent.drains.drains_open.Value
local water = script.Parent
local water_level = water.Size

---calculate gallons
wait(math.random(0.1, 1))
gallons_value = water.Size.Y * gallons_per_stud

---repeat until water level is 1
wait(math.random(0.1, 1))
while water_level <= Vector3.new(0, 1, 0) do
    ---are any drains open?
    wait(math.random(0.1, 1))
    if drains_open_value == 1 then
        ---lower the gallons value
        wait(math.random(0.4, 4))
        gallons_value = gallons_value - gallons_per_stud

        ---lower the size of water
        game.Workspace.tub_of_water.hot_water.Size = game.Workspace.tub_of_water.hot_water.Size - Vector3.new(0,1,0)
        print("slow decrease")
    end
    if drains_open_value == 2 then
        ---lower the gallons value
        wait(math.random(0.3, 3))
        gallons_value = gallons_value - gallons_per_stud

        ---lower the size of water
        game.Workspace.tub_of_water.hot_water.Size = game.Workspace.tub_of_water.hot_water.Size - Vector3.new(0,1,0)
        print("slowish decrease")
    end
    if drains_open_value == 3 then
        ---lower the gallons value
        wait(math.random(0.2, 2))
        gallons_value = gallons_value - gallons_per_stud

        ---lower the size of water
        game.Workspace.tub_of_water.hot_water.Size = game.Workspace.tub_of_water.hot_water.Size - Vector3.new(0,1,0)
        print("fastish decrease")
    end
    if drains_open_value == 4 then
        ---lower the gallons value
        wait(math.random(0.1, 1))
        gallons_value = gallons_value - gallons_per_stud

        ---lower the size of water
        game.Workspace.tub_of_water.hot_water.Size = game.Workspace.tub_of_water.hot_water.Size - Vector3.new(0,1,0)
        print("fast decrease")
    end
end

Answer this question