Engine Class
Fire
*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่
สรุป
คุณสมบัติ
ตัวอย่างโค้ด
การจุดไฟ
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) -- เลือกมิติที่ใหญ่ที่สุด
fire.Parent = descendant
end
endเปิด/ปิดเอฟเฟกต์ไฟ
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)เอกสารอ้างอิงเกี่ยวกับ API
คุณสมบัติ
Enabled
ตัวอย่างโค้ด
เปิดใช้งาน
local Debris = game:GetService("Debris")
local function douseFlames(fire)
fire.Enabled = false -- ไม่มีอนุภาคใหม่อีกต่อไป
Debris:AddItem(fire, 2) -- ลบวัตถุหลังจากอนุภาคที่มีอยู่หมดอายุ
end
local part = Instance.new("Part")
part.Anchored = true
part.Parent = workspace
local fire = Instance.new("Fire")
fire.Parent = part
douseFlames(part.Fire)size