The issue in line 8 is that Cursor.Position.X and Cursor.Position.Y are UDim values, not integers.
So how can you actually get the integer value of the mouse's X position?
Depending on what you are doing, you should either supply Cursor1Pos.Offset
or Cursor1Pos.Scale
A UDim's Offset and Scale are both integer values, however the Offset is the X position's value in pixels, and the Scale is the X position's value relative to your screen resolution.
I am assuming you want to use the Offset since the Offset is based on pixels, so here is a quick fix for you:
02 | if script.Parent.Parent.Parent.Cursor 1 InPlay.Value = = true then |
03 | script.Parent.Parent.Parent.Cursor 1 InPlay.Value = false |
04 | script.Parent.Parent.Parent.Cursor 2 InPlay.Value = true |
05 | elseif script.Parent.Parent.Parent.Cursor 2 InPlay.Value = = true then |
06 | script.Parent.Parent.Parent.Cursor 2 InPlay.Value = false |
07 | local Cursor 1 Pos = script.Parent.Parent.Cursor 1. Position.X |
08 | local x = 24.125 - ( 0.100520833 * (Cursor 1 Pos.Offset - 7 )) |
09 | workspace.PKLauncher.Orientation = Vector 3. new( 0 ,x, 90 ) |
12 | script.Parent.MouseButton 1 Click:connect(Click) |
Cursor1Pos - 7
will cause an error because no operator overload allows you to subtract a UDim with an integer. You can only subtract UDims with other UDims.
Cursor1Pos.Offset - 7
will not fail because you are subtracting two integers together, which is perfectly legal in programming.
I hope this helped you.