local is_in_bounds = function(bound_a, bound_b, position)
return position.x >= bound_a.x and position.y >= bound_a.y and position.x <= bound_b.x and position.y <= bound_b.y
end
local screen_size = EngineClient.GetScreenSize()
local dragging = false
local drag_offset = Vector2.new(0, 0)
local spectators_position_x = Menu.SliderFloat("window", "spectators_position_x", 1, 0, 0.25)
local spectators_position_y = Menu.SliderFloat("window", "spectators_position_y", 1, 0, 0.25)
local dragg = funcion()
local position = Vector2.new(spectators_position_x:Get() * screen_size.x, spectators_position_y:Get() * screen_size.y)
if Cheat.IsKeyDown(0x01) and Cheat.IsMenuVisible() then
local mouse_position = Cheat.GetMousePos()
if dragging == false and is_in_bounds(Vector2.new(position.x - 50, position.y - 9), Vector2.new(position.x + 50, position.y + 9), mouse_position) == true then
drag_offset.x = mouse_position.x - spectators_position_x * screen_size.x
drag_offset.y = mouse_position.y - spectators_position_y * screen_size.y
dragging = true
end
if dragging == true then
spectators_position_x:Set((mouse_position.x - drag_offset.x) / screen_size.x)
spectators_position_y.menu_var:Set((mouse_position.y - drag_offset.y) / screen_size.y)
end
else
dragging = false
end
end