BedWars Creative
  • 📜Changelog
  • ðŸŽĻSandbox Mode
  • 🊓WorldEdit Commands
  • ðŸ›ĄïļWorldGuard System
  • 🍊BedWars Scripting
    • 🚜Services
      • ðŸŽ―AbilityService
      • ðŸ“ĢAnnouncementService
      • ðŸ§ąBlockService
      • ðŸ”ĪChatService
      • ⚔ïļCombatService
      • 🌊ïļDisasterService
      • 🊅DataStoreService
      • ðŸŠĻEntityService
      • ðŸ”ĨForgeService
      • 🏭GeneratorService
      • ðŸ‘Đ‍🚀GravityService
      • âŒĻïļInputService
      • 🎒InventoryService
      • 💎ItemService
      • 🛏ïļMatchService
      • â„đïļMessageService
      • 🎁ModelService
      • ðŸĶĪMountService
      • 🏄‍♂ïļPlayerService
      • 🏗ïļPartService
      • 🎉ParticleService
      • 👆PromptService
      • 💰ShopService
      • ðŸ“ŧSoundService
      • 🊄StatusEffectService
      • 🚁VehicleService
      • ðŸšĐTeamService
      • ðŸĨ‡UIService
    • ðŸĪEvents
      • BeforeProjectileLaunched
      • BlockPlace
      • BlockBreak
      • BedAlarmTriggered
      • ConsumeItem
      • Enchant
      • EntityDamage
      • EntityDeath
      • EntitySpawn
      • Forged
      • InventoryItemAdded
      • ItemPurchase
      • MatchStart
      • PlayerChatted
      • PlayerAdded
      • PlayerRemoving
      • PlayerDropItem
      • PlayerPickupItem
      • ProjectileLaunched
      • ProjectileHit
      • StatusEffectAdded
      • StatusEffectRemoved
      • WeaponSwing
      • TeamUpgradePurchased
      • TeamUpgradeEraPurchased
      • Telepearled
      • UseAbility
    • ðŸ“ĶObjects
      • AbilityConfig
      • Block
      • Entity
        • ImageEntity
        • KitEntity
        • CreatureEntity
      • Generator
      • Knockback
      • Leaderboard
      • MatchState
      • Model
      • ParticleEmitter
      • Part
      • Player
      • Prompt
      • ProgressBar
      • TextLabel
      • Team
    • 📚Types
      • AbilityType
      • AbilityInputType
      • CreatureType
      • DisasterType
      • EnchantType
      • ItemType
      • KitType
      • ModelType
      • MountType
      • VehicleType
      • ProjectileType
      • SoundType
      • StatusEffectType
      • TeamUpgradeEraType
      • TeamUpgradeType
      • MatchRole
    • ⚙ïļUtilities
      • require
      • math
      • pairs & ipairs
      • print & error
      • os
      • string
      • table
      • task
      • tick
      • tostring & tonumber
      • wait
Powered by GitBook
On this page
  1. BedWars Scripting
  2. Services

ModelService

Service for creating models.

PreviousMessageServiceNextMountService

Last updated 1 year ago

Example usage:

-- 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: , position: ):

Creates a model of the given name at the specified position. You can further customize and give functionality to it using the returned object.

BedWars models available for use are contained in the list.

createItemModel(itemType: , position: ):

Creates a model of the given ItemType at the specified position. You can further customize and give functionality to it using the returned object. Note that some items do not have unique item models.

Example usage:

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)
🍊
🚜
🎁
ModelType
Vector3
Model
Model
ModelType
ItemType
Vector3
Model
Model