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

ParticleService

Service for creating ParticleEmitters.

Example usage:

-- 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

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.

PreviousPartServiceNextPromptService

Last updated 1 year ago

createParticleEmitter(position: , regionSize: ):

🍊
🚜
🎉
Vector3
Vector3
ParticleEmitter