You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
outputChatBox( string.format( "Cursor screen position (relative): X=%.4f Y=%.4f", screenx, screeny ) ) -- make the accuracy of floats 4 decimals
6
-
outputChatBox( string.format( "Cursor world position: X=%.4f Y=%.4f Z=%.4f", worldx, worldy, worldz ) ) -- make the accuracy of floats 4 decimals accurate
7
+
-- make the accuracy of floats 4 decimals and print to chatbox
Copy file name to clipboardExpand all lines: functions/Cursor/getCursorPosition.yaml
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ client:
4
4
description: |
5
5
This function gets the current position of the mouse cursor.
6
6
Note that for performance reasons, the world position returned is always 300 units away.
7
-
If you want the exact world point (similar to [[onClientClick]]), use [[processLineOfSight]] between the camera position and the worldX/Y/Z result of this function.
7
+
If you want the exact world point (similar to [onClientClick](/onClientClick)), use [processLineOfSight](/processLineOfSight) between the camera position and the world x/y/z result of this function.
The first two values are the 2D **relative** screen coordinates of the cursor.
13
-
The 3 values that follow are the 3D world map coordinates that the cursor points at.
13
+
The last 3 values are the 3D world map coordinates that the cursor points at.
14
14
If the cursor isn't showing, returns *false* as the first value.
15
15
values:
16
16
- type: 'float'
@@ -29,7 +29,7 @@ client:
29
29
examples:
30
30
- path: 'examples/getCursorPosition-1.lua'
31
31
description: |
32
-
This example prints your cursors current world coordinates and relative screen coordinates to chatbox after typing cursorpos.
32
+
This example prints your cursors current world coordinates and relative screen coordinates to chatbox after using */cursorpos* command.
33
33
- path: 'examples/getCursorPosition-2.lua'
34
34
description: |
35
-
This (untested) example uses processLineOfSight to calculate the exact world location: Warning, using the script down there will cause high CPU usage.
35
+
This (untested) example uses [processLineOfSight](/processLineOfSight) to calculate the exact world location: Warning, this script causes high CPU usage!
Copy file name to clipboardExpand all lines: functions/Cursor/isCursorShowing.yaml
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
shared: &shared
2
2
name: 'isCursorShowing'
3
3
description: |
4
-
This function determines the state of a player's cursor.
4
+
This function determines the state of a [player](/player)'s cursor.
5
5
notes:
6
-
- This function only handles the cursor state set by the [[showCursor]] function, ignoring it if the console, chatbox, or menu is open.
7
-
- If you use this function on the server-side, keep in mind that it only detects the [[showCursor]] function executed on the server-side and does not detect the function executed on the client-side.
6
+
- This function only handles the cursor state set by the [showCursor](/showCursor) function, ignoring it if the console, chatbox, or menu is opened.
7
+
- If you use this function on the server-side, keep in mind that it only detects the [showCursor](/showCursor) function executed on the server-side and not changes done by client-side.
8
8
returns:
9
9
description: |
10
-
Returns *true* if the player's cursor is visible, and *false* if it is not.
10
+
Returns *true* if the [player](/player)'s cursor is visible, and *false* if it is not.
11
11
values:
12
12
- type: 'bool'
13
13
name: 'result'
@@ -17,28 +17,28 @@ server:
17
17
parameters:
18
18
- name: 'playerElement'
19
19
type: 'player'
20
-
description: 'The [[player]] from whom we want to retrieve the cursor state.'
20
+
description: 'The [player](/player) from whom we want to retrieve the cursor state.'
21
21
examples:
22
22
- path: 'examples/isCursorShowing-1.lua'
23
23
description: |
24
-
This example creates a function to set the state of the player's cursor using the [[showCursor]] function.
24
+
This example creates a function to set the state of the [player](/player)'s cursor using the [showCursor](/showCursor) function.
25
25
- path: 'examples/isCursorShowing-2.lua'
26
26
description: |
27
-
This example creates a function that gets the state of the player's cursor and outputs it to the chatbox using the [[outputChatBox]] function.
27
+
This example creates a function that gets the state of the [player](/player)'s cursor and outputs it to the chatbox using the [outputChatBox](/outputChatBox) function.
28
28
29
29
client:
30
30
<<: *shared
31
31
examples:
32
32
- path: 'examples/isCursorShowing-3.lua'
33
33
description: |
34
-
This example creates a function to set the state of the player's cursor using the [[showCursor]] function.
34
+
This example creates a function to set the state of the [player](/player)'s cursor using the [showCursor](/showCursor) function.
35
35
- path: 'examples/isCursorShowing-4.lua'
36
36
description: |
37
37
If you are already advanced in scripting, using this code is recommended, as it is much more compact:
38
38
append: true
39
39
- path: 'examples/isCursorShowing-5.lua'
40
40
description: |
41
-
This example creates a function that allows the player to change the state of the cursor using the [[showCursor]] and [[bindKey]] functions.
41
+
This example creates a function that allows the [player](/player) to change the state of the cursor using the [showCursor](/showCursor) and [bindKey](/bindKey) functions.
42
42
- path: 'examples/isCursorShowing-6.lua'
43
43
description: |
44
44
If you are already advanced in scripting, using this code is recommended, as it is much more compact:
0 commit comments