Sparkles

Mostrar obsoleto

*Este conteúdo é traduzido por IA (Beta) e pode conter erros. Para ver a página em inglês, clique aqui.

Brilhos é uma das várias Classesde emissão de partículas.Como outros emissores de partículas de seu tipo, os objetos Brilhos emitem partículas quando são parentados a um BasePart (como um Part ) ou a um Attachment dentro de tal BasePart .Comparado à classe ParticleEmitter , Brilhos carece de muitas propriedades de personalização diferentes e métodos especiais, como ParticleEmitter.Lifetime ou ParticleEmitter:Emit().É útil criar um efeito especial rápido em um piscar de olhos; para um trabalho mais detalhado, é preferível usar um ParticleEmitter em vez disso.

Quando Sparkles.Enabled é desligado, as partículas emitidas por este objeto continuarão a renderizar até que sua vida útil expire.Quando um ObjetoSparkles Instance.Parent é definido como nil (e/ou Instance:Destroy() edit), todas as partículas desaparecerão instantaneamente.Se esse efeito não for desejado, tente ocultar o objeto pai em uma posição distante, então remova os Brilhos após alguns segundos usando Debris para dar às últimas partículas uma chance de expirar.Este objeto não tem um método ParticleEmitter:Clear() , mas é possível definir o Instance.Parent para nil e voltar ao mesmo objeto exato para o mesmo efeito.

Partículas brilhantes são emitidas apenas do centro de BasePart para o qual elas são parentadas.Parentar um objeto Sparkles para um Attachment em vez disso permite a personalização da posição de início dos particípulos.

Amostras de código

The code sample below gives any new players sparkles that are colored the same as their torso color.

Give Sparkles

local Players = game:GetService("Players")
local function onCharacterSpawned(character)
local hrp = character:WaitForChild("HumanoidRootPart")
-- Add sparkles that are colored to the player's torso color
local sparkles = Instance.new("Sparkles")
sparkles.Parent = hrp
sparkles.SparkleColor = character:WaitForChild("Body Colors").TorsoColor.Color
sparkles.Enabled = true
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterSpawned)
end
Players.PlayerAdded:Connect(onPlayerAdded)

Resumo

Propriedades

Propriedades

Color

Oculto
Não replicado
Ler Parallel

Amostras de código

Give Sparkles

local Players = game:GetService("Players")
local function onCharacterSpawned(character)
local hrp = character:WaitForChild("HumanoidRootPart")
-- Add sparkles that are colored to the player's torso color
local sparkles = Instance.new("Sparkles")
sparkles.Parent = hrp
sparkles.SparkleColor = character:WaitForChild("Body Colors").TorsoColor.Color
sparkles.Enabled = true
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterSpawned)
end
Players.PlayerAdded:Connect(onPlayerAdded)

Enabled

Ler Parallel

Amostras de código

Give Sparkles

local Players = game:GetService("Players")
local function onCharacterSpawned(character)
local hrp = character:WaitForChild("HumanoidRootPart")
-- Add sparkles that are colored to the player's torso color
local sparkles = Instance.new("Sparkles")
sparkles.Parent = hrp
sparkles.SparkleColor = character:WaitForChild("Body Colors").TorsoColor.Color
sparkles.Enabled = true
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterSpawned)
end
Players.PlayerAdded:Connect(onPlayerAdded)

LocalTransparencyModifier

Oculto
Não replicado
Ler Parallel

SparkleColor

Ler Parallel

Amostras de código

Give Sparkles

local Players = game:GetService("Players")
local function onCharacterSpawned(character)
local hrp = character:WaitForChild("HumanoidRootPart")
-- Add sparkles that are colored to the player's torso color
local sparkles = Instance.new("Sparkles")
sparkles.Parent = hrp
sparkles.SparkleColor = character:WaitForChild("Body Colors").TorsoColor.Color
sparkles.Enabled = true
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterSpawned)
end
Players.PlayerAdded:Connect(onPlayerAdded)

TimeScale

Ler Parallel

Métodos

Eventos