You can write your topic however you want, but you need to answer these questions:
I am trying to recreate the fire death effect from psychic playground - Roblox
(Cannot upload video, I’ll try again later)
When I attempt to try and test the lava, studio freezes like so:
(Cannot upload video, I’ll try again later)
3: This is my code. Script:
function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit:FindFirstChild("Burn") == nil then
hit.Parent.Humanoid.Health = 0
local v = hit.Parent:GetDescendants()
for i = 1, #v do
if v[i]:IsA("BasePart") then
local bloodthing = v[i]:Clone()
bloodthing.Parent = v[i].Parent
bloodthing.CFrame = v[i].CFrame
local w = Instance.new("WeldConstraint")
w.Parent = v[i]
w.Part0 = v[i]
w.Part1 = bloodthing
local bsc = script.Parent.Burn:Clone()
bsc.Parent = bloodthing
bsc.Disabled = false
v[i].Material = Enum.Material.Sand
v[i].Color = Color3.fromRGB(99, 95, 98)
end
end
end
end
connection = script.Parent.Touched:connect(onTouched)
Burn:
local TweenService = game:GetService("TweenService")
local info = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
1
)
local Goals = {
Transparency = 1,
}
local function fadify(obj)
if obj:IsA("BasePart") then
local PartTween = TweenService:Create(obj, info, Goals)
PartTween:Play()
obj.Size += Vector3.new(0.01, 0.01, 0.01)
obj.Material = Enum.Material.Neon
obj.BrickColor = BrickColor.new("Neon orange")
elseif obj:IsA("Decal") then
local PartTween = TweenService:Create(obj, info, Goals)
PartTween:Play()
end
end
local v = script.Parent:GetChildren()
for i = 1, #v do
if v[i]:IsA("Accessory") or v[i]:IsA("Shirt") or v[i]:IsA("ShirtGraphic") or v[i]:IsA("Pants") then
v[i]:Destroy()
end
end
fadify(script.Parent)
script:Destroy()
That could be because your onTouched function has no debounce, so it ends up inserting parts and scripts into all of your character’s descendants millions of times. You have to label the character in some kind of way that tells the script that it already touched it. You could use a table, CollectionService, attributes, or BoolValues, whatever you see fit.