Lớp công cụ
Sparkles
*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.
Tóm Tắt
Thuộc Tính
Mẫu mã
Tặng Sparkles
local Players = game:GetService("Players")
local function onCharacterSpawned(character)
local hrp = character:WaitForChild("HumanoidRootPart")
-- Thêm sparkles có màu giống với màu thân của người chơi
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)Tài Liệu Tham Khảo API
Thuộc Tính
Color
Enabled
Mẫu mã
Tặng Sparkles
local Players = game:GetService("Players")
local function onCharacterSpawned(character)
local hrp = character:WaitForChild("HumanoidRootPart")
-- Thêm sparkles có màu giống với màu thân của người chơi
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)Đã bật
local Debris = game:GetService("Debris")
local part = Instance.new("Part")
part.Parent = workspace
local sparkles = Instance.new("Sparkles")
sparkles.Parent = part
function stopSparkling(sparkles)
sparkles.Enabled = false -- Không còn hạt mới
Debris:AddItem(sparkles, 4) -- Xóa đối tượng sau một khoảng thời gian (sau khi các hạt hiện có đã hết hạn)
end
stopSparkling(part.Sparkles)SparkleColor
Mẫu mã
Tặng Sparkles
local Players = game:GetService("Players")
local function onCharacterSpawned(character)
local hrp = character:WaitForChild("HumanoidRootPart")
-- Thêm sparkles có màu giống với màu thân của người chơi
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)