# ParticleService

Example usage:

```lua
-- Create a record player and add music note particles on all beds
local rainbowColorSequence = ColorSequence.new({
    ColorSequenceKeypoint.new(0, Color3.fromRGB(255, 115, 115)),
    ColorSequenceKeypoint.new(0.2, Color3.fromRGB(255, 188, 105)),
    ColorSequenceKeypoint.new(0.3, Color3.fromRGB(251, 255, 124)),
    ColorSequenceKeypoint.new(0.5, Color3.fromRGB(150, 255, 129)),
    ColorSequenceKeypoint.new(0.6, Color3.fromRGB(101, 201, 255)),
    ColorSequenceKeypoint.new(0.8, Color3.fromRGB(140, 120, 255)),
    ColorSequenceKeypoint.new(1, Color3.fromRGB(255, 139, 255)),
})

local teams = TeamService.getAllTeams()
for i, team in ipairs(teams) do
    local block = TeamService.getTeamBed(team)
    local positionAbove = block.position + Vector3.new(0, 2.5, 0)
    local recordPlayer = ModelService.createModel(ModelType.RECORD_PLAYER, positionAbove)

    local emitter = ParticleService.createParticleEmitter(positionAbove, Vector3.new(0, 0, 0))

    emitter:setTexture("rbxassetid://7065482760")

    emitter:setRate(1.75)
    emitter:setLifetime(NumberRange.new(6, 7))
    emitter:setSpeed(NumberRange.new(1.7, 2))
    emitter:setDrag(0.25)
    emitter:setBrightness(1)
    emitter:setParticleOrientation(ParticleOrientation.FacingCamera)
    emitter:setSpreadAngle(Vector2.new(-20,45))
    emitter:setColor(rainbowColorSequence)
end
```

### Functions

#### createParticleEmitter(position: [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3), regionSize: [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3)): [ParticleEmitter](/scripting/bedwars-scripting/objects/particleemitter.md)

Creates a ParticleEmitter at the specified position. If `regionSize` is set to `Vector3.new(0,0,0)`, then the particles will emit from a point at the position. Otherwise, the particles will emit from the size of the `regionSize`.


---

# Agent Instructions: 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:

```
GET https://docs.easy.gg/scripting/bedwars-scripting/services/particleservice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
