Im trying to compare to Vector2 values but it just ends up give me an error.
My code:
local mouse = Player:GetMouse()
local mouseScreenSize = Vector2.new(mouse.ViewSizeX, mouse.ViewSizeY)
if mouseScreenSize >= Vector2.new(852,414) then
PlayerGui.Main.InventoryMoble.Visible = true
PlayerGui.Main.Inventory.Visible = false
end
You can’t compare Vector2’s in the same way as numbers (so instead we convert them to numbers). Try this out:
local mouse = Player:GetMouse()
local mouseScreenSize = Vector2.new(mouse.ViewSizeX, mouse.ViewSizeY)
if mouseScreenSize.Magnitude >= Vector2.new(852,414).Magnitude then
PlayerGui.Main.InventoryMoble.Visible = true
PlayerGui.Main.Inventory.Visible = false
end