I've been experiencing an issue with my small code

  1. What do you want to achieve? A system that is connected to a draggable GUI (For ex. if you drag the GUI to the right it increases the volume ( not what I want to achieve just an example).

  2. What is the issue? I’ve tried to use position for it but I don’t know how to mention numbers
    in-between (for ex. 10 to 20 would be getting all numbers bigger than 10 and smaller than 20 if it is then it would start the if statement).

  3. What solutions have you tried so far? I have asked a friend but I think he was busy/couldn’t find it.

I’ve been trying to make a small project for a science fair type of thing but I can’t get over the scripting because I can’t script well. Here is my small script.

local sun = game.Workspace.sun
local button = script.Parent.C
local BPosition = button.Position 
local orbitparts = game.Workspace.Orbit

if  BPosition.X >= 0.06 and  <  0.082 then 
	sun.Position = orbitparts.Part1
end

Here is the error it gives

Players.bahakayra1318.PlayerGui.ScreenGui.Position:6: attempt to compare number <= UDim

Alternatively I was gonna try to make it attached to a brick and it would rotate with the button. And I would get a value to check its position and make it assign other types of values I want to change.

I tried to make the drawing simple as possible.

Thanks for looking at this thread I’ll see you around!

GuiPosition.X and GuiPosition.Y are UDim values. Please use GuiPosition.X.Scale and GuiPosition.Y.Scale Hope this helps! :grinning_face_with_smiling_eyes: