-- Torch/Script
local torch = script.Parent
local fx = torch:FindFirstChildOfClass("ParticleEmitter")
local light = torch:FindFirstChildOfClass("PointLight")
local prompt = torch:FindFirstChildOfClass("ProximityPrompt")
local aktif = true
local function setOn(on)
aktif = on
if fx then fx.Enabled = on end
if light then light.Enabled = on end
end
setOn(true)
prompt.Triggered:Connect(function(player)
setOn(not aktif)
end)
Langkah 5 — Efek Ledakan Saat Disentuh
Tambahkan sebuah blok “BoomBlock” lalu susun script berikut:
-- BoomBlock/Script
local part = script.Parent
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local e = Instance.new("Explosion")
e.BlastRadius = 6
e.BlastPressure = 200000
e.Position = part.Position
e.Parent = workspace
end
end)
Catatan: atur BlastRadius kecil supaya aman untuk anak.
Langkah 6 — Polish
Tambahkan Smoke sebagai ParticleEmitter kedua (Rate kecil: 5–8)
Ubah warna PointLight ke oranye agar hangat
Duplikat Torch beberapa kali untuk suasana gua
Tips
Semakin tinggi Rate, semakin berat performa
Gunakan Enabled untuk mengaktif/nonaktifkan efek lewat kode
Letakkan efek di Attachment agar posisinya mudah diatur
Quiz (3 Pertanyaan)
Q1. Komponen untuk menyalakan/mematikan efek dari dekat adalah…
ClickDetector
ProximityPrompt
BillboardGui
Q2. Properti mana yang membuat partikel muncul lebih banyak tiap detik?
Rate
Lifetime
Color
Q3. Agar cahaya obor menyala, komponen yang digunakan adalah…