Kelas Engine
Fire
*Konten ini diterjemahkan menggunakan AI (Beta) dan mungkin mengandung kesalahan. Untuk melihat halaman ini dalam bahasa Inggris, klik di sini.
Rangkuman
Properti
Contoh Kode
Menyalakan Obor
local Workspace = game:GetService("Workspace")
for _, descendant in Workspace:GetDescendants() do
if descendant.Name == "Torch" and descendant:IsA("BasePart") then
local fire = Instance.new("Fire")
fire.Heat = 10
fire.SecondaryColor = Color3.new(1, 1, 1)
fire.Size = math.max(descendant.Size.X, descendant.Size.Z) -- Pilih yang lebih besar dari dua dimensi
fire.Parent = descendant
end
endMengalihkan Efek Api
local part = script.Parent
local clickDetector = Instance.new("ClickDetector")
clickDetector.Parent = part
local fire = Instance.new("Fire")
fire.Parent = part
local light = Instance.new("PointLight")
light.Parent = part
local function onClick()
fire.Enabled = not fire.Enabled
light.Enabled = fire.Enabled
end
clickDetector.MouseClick:Connect(onClick)Referensi API
Properti
Enabled
Contoh Kode
Diaktifkan
local Debris = game:GetService("Debris")
local function douseFlames(fire)
fire.Enabled = false -- Tidak ada partikel baru lagi
Debris:AddItem(fire, 2) -- Hapus objek setelah partikel yang ada telah kedaluwarsa
end
local part = Instance.new("Part")
part.Anchored = true
part.Parent = workspace
local fire = Instance.new("Fire")
fire.Parent = part
douseFlames(part.Fire)size