Hi,
I’m creating a strategy game where you can create your own maps. However, when I tested out the background editor, where you can choose the x to z ratio of the background, I came across a problem. The ‘>’ operator doesn’t seem to be working correctly. It (most likely) only looks to the first character and (probably) only looks to the second character if the first two are equal (e.g. in 3:20 it compares 3 and 2, and in 2:20 it compares 2 and 20)
The relevant code:
Remotes.MapChangeEvent.OnServerEvent:Connect(function(plr, ID, ratio_array)
backgr.MapImage.Texture = getImageIdFromDecal(ID)
print(ratio_array[1]+2) -- the +2 here is to show that the value is a number, not a string
print(ratio_array[2]+2)
if ratio_array[1] > ratio_array[2] then
print(tostring(ratio_array[1]).." is bigger than "..tostring(ratio_array[2]))
backgr.Size = Vector3.new(2048, 0.1, ratio_array[2]/ratio_array[1]*2048)
else
print(tostring(ratio_array[1]).." is smaller than "..tostring(ratio_array[2]))
print(ratio_array)
backgr.Size = Vector3.new(ratio_array[1]/ratio_array[2]*2048,0.1,2048)
end
end)
I have never seen this behavior before, but maybe I missed something?
If you need extra code, please let me know!