Sparkles

显示已弃用

*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处

闪光是几个粒

Sparkles.Enabled

闪光粒子只能从BasePart的中心发射,它们的父辈是。父辈一个闪光对象到一个Attachment,而不是直接父辈它们。

代码示例

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)

概要

属性

属性

Color

隐藏
未复制
读取并联

颜色属性确定所有粒子发射的颜色,通过 Sparkles 对象(既有粒子又有未来粒子)。它与 ParticleEmitter.Color 无异,除了它是一个颜色而不是一个 ColorSequence 。闪光有一个自然的颜色序

需要注意,闪光有一个部分 ParticleEmitter.LightEmission 效果,因此黑暗颜色往往会更加透明,白色颜色看起来很亮。

代码示例

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)

Enabled

读取并联

启用属性,与 ParticleEmitter.Enabled 一样,确定是否发射闪光粒子。任何已发射的粒子都会继续渲染直到其有效期过期。 此属性对于让预制闪光效果不再可用,直到需要它们稍后。 由于


local Debris = game:GetService("Debris")
local part = script.Parent
function stopSparkling(sparkles)
sparkles.Enabled = false -- No more new particles
Debris:AddItem(sparkles, 4) -- Remove the object after a delay (after existing particles have expired)
end
stopSparkling(part.Sparkles)

代码示例

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)

LocalTransparencyModifier

隐藏
未复制
读取并联

SparkleColor

读取并联

这个属性与 Sparkles.Color 相同。

闪光颜色属性确定所有颗粒发出的颜色都是通过 Sparkles 对象(既有现有又未来的颗粒)来发出的颜色。它与 ParticleEmitter.Color 的行为相同,除了它是一个颜色而不是一个 Datatype.ColorSequ

需要注意,闪光有一个部分 ParticleEmitter.LightEmission 效果,因此黑暗颜色往往会更加透明,白色颜色看起来很亮。

代码示例

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)

TimeScale

读取并联

方法

活动