local Particles = game.ReplicatedStorage.Effects.Particles
local Highlights = game.ReplicatedStorage.Effects.Highlights
local Parts = game.ReplicatedStorage.Effects.Parts
local BindableEvents = game.ReplicatedStorage.Events.BindableEvents
local RemoteEvents = game.ReplicatedStorage.Events.RemoteEvents
local TweenService = game:GetService("TweenService")
local CollectionService = game:GetService("CollectionService")
local NewRandom = Random.new()
local IcePhysicalProperties = PhysicalProperties.new(1, 0.001, 0.5, 100, 1)
local PhysicalPropertiesList = {}
function SetPartSurfaceType(Part, SurfaceType, SettingDelay)
task.wait(SettingDelay)
Part.FrontSurface = SurfaceType
Part.BackSurface = SurfaceType
Part.TopSurface = SurfaceType
Part.BottomSurface = SurfaceType
Part.RightSurface = SurfaceType
Part.LeftSurface = SurfaceType
end
CollectionService:GetInstanceAddedSignal("OnFire"):Connect(function(TagInstance)
if TagInstance:FindFirstChild("Humanoid") then
if not TagInstance:HasTag("ImmuneToFire") and not TagInstance:HasTag("CannotCatchFire") then
local Humanoid = TagInstance.Humanoid
local FireHighlight = Highlights.FireHighlight:Clone()
FireHighlight.Parent = TagInstance
BindableEvents.DoDamage:Fire("Fire", TagInstance, 5, 0.5, 10)
TweenService:Create(FireHighlight, TweenInfo.new(1), {FillTransparency = 0.5, OutlineTransparency = 0}):Play()
for i = 1, 20 do
if not TagInstance:HasTag("OnFire") then
break
end
task.wait(0.25)
if Humanoid.FloorMaterial ~= Enum.Material.Air then
Humanoid.Jump = true
end
end
TagInstance:RemoveTag("OnFire")
end
else
TweenService:Create(TagInstance, TweenInfo.new(1), {Color = Color3.fromRGB(255, 125, 0)}):Play()
SetPartSurfaceType(TagInstance, Enum.SurfaceType.Weld, 0.3)
local Fire = Particles.Fire:Clone()
Fire.Rate = TagInstance.Size.Magnitude * 10
Fire.Parent = TagInstance
local TouchConnection = TagInstance.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild("Humanoid")
and not Hit.Parent:HasTag("ImmuneToFire")
and not Hit.Parent:HasTag("CannotCatchFire") then
Hit.Parent:AddTag("OnFire")
end
end)
local TagSignal
TagSignal = game.CollectionService:GetInstanceRemovedSignal("OnFire"):Connect(function(TagInstance2)
if TagInstance2 == TagInstance then
TouchConnection:Disconnect()
TagSignal:Disconnect()
end
end)
for i = 1, 5 do
task.wait(3)
if not TagInstance:HasTag("OnFire") then
break
end
for i, v in pairs(workspace:GetPartBoundsInBox(TagInstance.CFrame, TagInstance.Size * 1.1)) do
if v:IsA("BasePart") and
(not v:HasTag("OnFire")
and not v:HasTag('CannotCatchFire') and
not v:HasTag("Unchangeable")
and v.Size.Magnitude < TagInstance.Size.Magnitude * 5
and not v.Parent:FindFirstChild("Humanoid")) then
v:AddTag("OnFire")
end
end
end
task.wait(1.5)
TagInstance:RemoveTag("OnFire")
end
end)
CollectionService:GetInstanceRemovedSignal("OnFire"):Connect(function(TagInstance)
if TagInstance:FindFirstChild("Humanoid") then
TagInstance.Humanoid:RemoveTag("BeingDamagedBySourceFire")
end
if TagInstance:FindFirstChild("Fire") then
TagInstance:FindFirstChild("Fire"):Destroy()
end
if TagInstance:FindFirstChild("FireHighlight") then
TweenService:Create(TagInstance:FindFirstChild("FireHighlight"), TweenInfo.new(1), {FillTransparency = 1, OutlineTransparency = 1}):Play()
end
if TagInstance:IsA("BasePart") then
TweenService:Create(TagInstance, TweenInfo.new(1), {Color = Color3.fromRGB(0, 0, 0)}):Play()
end
TagInstance:AddTag("CannotCatchFire")
task.wait(2)
TagInstance:RemoveTag("CannotCatchFire")
if TagInstance:FindFirstChild("FireHighlight") then
TagInstance:FindFirstChild("FireHighlight"):Destroy()
end
end)
CollectionService:GetInstanceAddedSignal("Chilled"):Connect(function(TagInstance)
TagInstance:AddTag("ImmuneToFire")
TagInstance:RemoveTag("OnFire")
if TagInstance:FindFirstChild("Humanoid") then
local Ice = Parts.Ice:Clone()
Ice.CFrame = TagInstance.HumanoidRootPart.CFrame
Ice.Anchored = false
Ice.Parent = TagInstance
local IceWeld = Instance.new("WeldConstraint")
IceWeld.Part0 = TagInstance.HumanoidRootPart
IceWeld.Part1 = Ice
IceWeld.Parent = Ice
TagInstance.Humanoid:RemoveTag("BeingDamagedBySourceFire")
TagInstance:AddTag("ImmuneToFire")
TagInstance:AddTag("Ragdolled")
else
PhysicalPropertiesList[TagInstance] = TagInstance.CustomPhysicalProperties
TagInstance.CustomPhysicalProperties = IcePhysicalProperties
TweenService:Create(TagInstance, TweenInfo.new(1), {Reflectance = 0.5}):Play()
end
task.wait(10)
TagInstance:RemoveTag("Chilled")
end)
CollectionService:GetInstanceRemovedSignal("Chilled"):Connect(function(TagInstance)
TagInstance:RemoveTag("ImmuneToFire")
if TagInstance:FindFirstChild("Humanoid") then
if TagInstance:FindFirstChild("Ice") then
TagInstance:FindFirstChild("Ice"):Destroy()
end
TagInstance:RemoveTag("Ragdolled")
else
TagInstance.CustomPhysicalProperties = PhysicalPropertiesList[TagInstance]
TweenService:Create(TagInstance, TweenInfo.new(1), {Reflectance = 0}):Play()
PhysicalPropertiesList[TagInstance] = nil
end
end)
I have code (the thing just above this text) but I want to know if it’s actually good. I’ve heard a lot about the numbers thing “ohh variablize your numbers to make code more clear” and yes, I’ll do that at some point, but other then that, is this code presentable at all? could I use this in a game without looking like I have no clue what I am doing? Is this code slow? What should I improve?
I’ve been weary of my own code and how it may look when someone else reads it back for a while, just want to know if my fears are founded.


