> For the complete documentation index, see [llms.txt](https://docs.giftoin.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.giftoin.org/platform-guides/roblox/tools-and-scripts/rotating-script.md).

# Rotating Script

<figure><img src="/files/Q78tFsudqXBJj1pzU4qF" alt=""><figcaption></figcaption></figure>

```lua
local coin = script.Parent

local function rotate ()
	while true do
		coin.Orientation = coin.Orientation + Vector3.new(0, 3, 0)
		wait()
	end
end

rotate()

```

### How to Use:

1. Create a new Script in Roblox Studio.
2. Copy and paste the above code into the script.
3. Place the script as a child of the object you want to rotate.
4. The object will now rotate continuously around its Y-axis.

### Customization:

* To change the rotation speed or axis, modify the Vector3 values:
  * `Vector3.new(X, Y, Z)`:
    * X controls rotation around the X-axis
    * Y controls rotation around the Y-axis
    * Z controls rotation around the Z-axis
* Increase the numbers for faster rotation, decrease for slower rotation.

### Example Use Cases:

* Rotating coins or collectibles
* Creating spinning power-ups
* Animating decorative elements in your game world

\ <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.giftoin.org/platform-guides/roblox/tools-and-scripts/rotating-script.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
