> For the complete documentation index, see [llms.txt](https://docs.easy.gg/scripting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.easy.gg/scripting/bedwars-scripting/services/modelservice.md).

# ModelService

Example usage:

```lua
-- Create a beachball above all iron blocks
local ironBlocks = BlockService.getAllBlocks({ ItemType.IRON_BLOCK })
for i, block in ipairs(ironBlocks) do
    local positionAbove = block.position + Vector3.new(0, 3, 0)
    local beachball = ModelService.createModel(ModelType.BEACHBALL, positionAbove)
    beachball:setAnchored(false)
    beachball:setCollidable(true)
    beachball:setScale(0.75)
end
```

### Functions

#### createModel(modelType: [ModelType](/scripting/bedwars-scripting/types/modeltype.md), position: [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3)): [Model](/scripting/bedwars-scripting/objects/model.md)

Creates a model of the given name at the specified position. You can further customize and give functionality to it using the returned [Model](/scripting/bedwars-scripting/objects/model.md) object.

BedWars models available for use are contained in the [ModelType](/scripting/bedwars-scripting/types/modeltype.md) list.

#### createItemModel(itemType: [ItemType](/scripting/bedwars-scripting/types/itemtype.md), position: [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3)): [Model](/scripting/bedwars-scripting/objects/model.md)

Creates a model of the given ItemType at the specified position. You can further customize and give functionality to it using the returned [Model](/scripting/bedwars-scripting/objects/model.md) object. Note that some items do not have unique item models.

Example usage:

```lua
Events.BlockPlace(function(event)
    if (event.blockType ~= ItemType.STONE_BRICK) then
        return
    end    

    local model = ModelService.createItemModel(ItemType.RAGEBLADE, event.position + Vector3.new(0,4,0))
    model:setScale(1.2)
    model:setRotation(Vector3.new(0,90,0))
end)
```
